GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — bash/cutter.sh at master · gitbilla/bash Expand file tree/ Copy pathcutter.shMore file actions executable file ·35 lines (30 loc) · 911 Bytes / Copy pathcutter.shFile metadata and controlsexecutable file ·35 lines (30 loc) · 911 Bytes 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. |