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 — shell-script/020-DIR.sh at master · srinivart/shell-script Expand file tree/ Copy path020-DIR.shMore file actions executable file ·50 lines (44 loc) · 1.15 KB / Copy path020-DIR.shFile metadata and controlsexecutable file ·50 lines (44 loc) · 1.15 KB 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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 #!/bin/sh # DIR - pretend we're the DIR command in DOS and display the contents # of the specified file, accepting some of the standard DIR flags usage() { cat << EOF >&2 Usage: $0 [DOS flags] directory or directories Where: /D sort by columns /H show help for this shell script /N show long listing format with filenames on right /OD sort by oldest to newest /O-D sort by newest to oldest /P pause after each screenful of information /Q show owner of the file /S recursive listing /W use wide listing format EOF exit 0 } postcmd="" flags="" while [ $# -gt 0 ] do case $1 in /D ) flags="$flags -x" ;; /H ) usage ;; /[NQW] ) flags="$flags -l" ;; /OD ) flags="$flags -rt" ;; /O-D ) flags="$flags -t" ;; /P ) postcmd="more" ;; /S ) flags="$flags -s" ;; * ) # unknown flag: probably a dir specifier break; # so let's get outta the while loop esac shift # processed flag, let's see if there's another done # done processing flags, now the command itself: if [ ! -z "$postcmd" ] ; then ls $flags "$@" | $postcmd else ls $flags "$@" fi 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. |