GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bash/cutter.sh at master · gitbilla/bash

Expand file tree

/

cutter.sh

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
35 lines (30 loc) · 911 Bytes
/

cutter.sh

Copy path

File metadata and controls

executable file
·
35 lines (30 loc) · 911 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Written by Alexander Löhner
# The Linux Counter Project
if [ "${1}" = "" ]; then
echo "Argument 1 has to be the start position (linenumber) to begin the cut"
echo "This line will be included in your resulting file as the first line"
echo "You may use \"grep -n\" to get the linenumber"
exit 1
fi
if [ "${2}" = "" ]; then
echo "Argument 2 has to be the end position (linenumber) to end the cut"
echo "This line will be included in your resulting file as the last line"
echo "You may use \"grep -n\" to get the linenumber"
exit 1
fi
if [ "${3}" = "" ]; then
echo "Argument 3 has to be the filename of the original file to cut from"
exit 1
fi
if [ "${4}" = "" ]; then
echo "Argument 4 has to be the filename of the new, resulting file"
exit 1
fi
begin=$(( ${1} - 1 ))
head -n ${2} ${3} > ${3}.tmp
lines=$(( ${2} - ${begin} ))
tail -n ${lines} ${3}.tmp > ${4}
rm -f ${3}.tmp
echo "Done."
exit 0
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.