source exit  cat /etc/profile pg !$ pg /etc/profile man ksh cat .profile pwd cd .. !ca cat .profile set a="(a b c d e f g h i j k l m n o) " echo $a echo $a{11} echo $a(11) echo ${11} a=(a b c d e f j h i j k l) fc pwd mkdir 13 cd 13 vi max ksh max a b c d e f h i j k l m n o p typeset -u NAME NAME="Barbara Jackson" echo $NAME echo $name count=20 typeset -i 2 bcount typeset -i 2 bcount ksh -i2 bcount man ksh typeset typeset -i 2 xx typeset -i 10 xx ‚$ls typeset -i xx typeset typeset typeset typeset -i 2 typeset "-i 2" xxx ps typeset -i bcount bcount=$count echo $count $bcount typeset -i 2 bcount typeset -i2 bcount !bcount= bcount=$count !echo echo $count $bcount typeset -L 8 fruit1 fruit2 typeset -L8 fruit1 fruit2 fruit1=apple fruit2=watermelon echo $fruit1$fruit2 echo $fruit2$fruit1 typeset -Z2 day day=2;echo $day typeset -L month month=11;echo $month/$day/98 month=8;echo $month/$dat/98 echo $month/ PATH=xxx ‚Btypeset –r PATH FPATH=/usr/local/funcs typeset -r PATH FPATH=yyyy PATH=555 f typeset PATH typeset month typeset day typeset typeset fruit1 typeset | pg typeset | more set exit typeset -Z2 day day=2; echo day echo $day typeset day whereis typeset which typeset count=10 function count_down { typeset count count=$1 while ((count>0)); do echo "$count..." ((count=count-1)) done echo "Blast Off\!" return } echo $count count_down 6 echo "!" echo $count cat file1 file2 file3 > all3files ‚[echo $_ pwd cd ../13 man csh pwd cat > showline chmod 700 showline showline myname=alex set -x echo $myname PS4="DBG: " echo $myname man mkdir pwd mkdir -p top/level2/level3 set +x ln -s top/level2 symdir cd symdir /bin/pwd echo $PWD pwd /bin/pwd cat > quiz vi quiz chmod 700 quiz quiz quiz quiz cat quiz vi quiz quiz quiz cat quiz finish=50 start=44 echo $((finish - start)) echo %((finish-start)) echo %((finish - start)) echo %(( finish - start )) echo $[finish-start] ‚„eval $[finish-start] SOURCEFILE=/usr/local/src/prog.c echo ${SOURCEFILE#/k/} echo ${SOURCEFILE/*/} fc echo ${SOURCEFILE#/*/} echo ${SOURCEFILE##/*/} s=/usr/local/src/prog.c echo ${s%/*} echo ${s%%/*} echo ${s%.c} c=$s#/*/} echo $c c=${s##/*/} echo $c c=${s#/*/} echo $c n=${c%%/*} echo $n IFS=: a=a:b:c:d cat $a ex set set | grep IF echo $a exit a=a:b:c:d IFS=: cat $a exit a=a:b:c:d cat $a echo ${+a} echo ${#name} a=123 edcho echo ${+a} sf=/usr/local/src/Misc/viewfax–2.2/faxinput.c ‚ͺecho ${#sf} exit exit ps ls ls f* NOGLOB=x ls f* NO_GLOB=x ls f* set NO_GLOB ls f* ls /bin/ksh strings /bin/ksh | grep -i noglob ^no^extended strings /bin/ksh | grep -i extendedglob fc strings /bin/ksh | grep -i nullglob cd 13 ls cd\\\ pwd pwd ls ../13 ls ls f* exit pwd cd ../13 ls f* ls cd ../12 ls f* ls man ksh n man ksh NAMES=(alex helen jenny scott) set -A five 1 2 3 4 5 echo $five echo $five[2-4] echo $five(3) echo $five[3] echo $five{3} ‚Τhelp echo $five [3] echo $file[3] echo $five[3] echo $five[2] echo $five\[3\] echo $five typeset five typeset $five typeset asdf set -A one two three four five echo $one{three} echo $one typeset -A ar one two three four five set -A ar one two three four five echo $ar echo $ar ${ar[3]} echo ${ar[0]} echo $ar echo $ar[2] echo ${ar[2]} set -A NAMES=(alex helen jenny scott) history set -A NAMES (alex helen jenny scott) set -A NAMES alex helen jenny scott echo $NAMES ‚ώecho $(NAMES[2]) echo ${NAMES[2]} echo ${NAMES[2,4]} echo ${NAMES[*]} man man man ksh > hold.ksh pg hold.ksh ftp speedy echo ${NAMES[-1]} set A "$NAMES[*]" set B "$NAMES[@]" echo $A echo $B echo $NAMES[@] echo ${NAMES[@]} echo "${NAMES[@]}" set A "${NAMES[@]}" set B "${NAMES[*]}" echo #{#A} echo $A set set |pg !! set |pg set A "${NAMES[*]}" echo $A set A 1 2 3 echo $A echo ${A[2]} echo "${NAMES[*]}" set A "${NAMES[*]}" set |pg ls set A 1 2 3 4 set |head ‚!q set A "1 2 3 4" set | head set q 1 2 3 4 set | grep q set -A A "${NAMRS[*]}" set | head set echo $a echo $A set -A B "${NAMES[@]}" set | head set -A A "${NAMES[*]}" set | head echo $A echo $B echo ${#A} echo ${#B} echo $A[*] echo ${B[*]} set -A aa1 ab cd set |head set aa2 = set -A "${aa1[*]}" set -A aa2 "${aa1[*]}" set aa2 = set -A "${aa1[@]}" set -A aa2 "${aa1[@]}" set history set -A aa2 "${aa1[*]}" set history -3 set -A aa2 "${aa1[@]}" echo aa2[*] set ‚Ehistory set -A aa2 "${aa1[*]}" set history set -A aa2 "${aa1[@]}" set echo $A echo $B echo ${#A} echo $#A echo $A[1] echo ${A[1]} set | head set | head -5 man ksh NAMES[2] = william set -A NAMES[2] william set -A ${NAMES[2]} william set | head set set | grep -i names history set -A "${NAMES[2]}" william !345 set | grep -i names set | grep -i william let let "v=v*10+n" v=5 n=10 let "v = v * 10 + n" echo $v v=6 ((v = v * 10 + n)) echo $v ((v=v*10+n)) echo $v ‚jv=6 ((v=v*10+n)) echo $v let "v=v*10+n" echo $v let COUNT=COUNT+1 "VALUE=VALUEj10 +NEW" COUNT=5 VALUE=10 NEW=14 let COUNT=COUNT+1 "VALUE=VALUE*10+NEW" echo $COUNT $VALUE echo $((COUNT+5)) echo [COUNT+5] echo [ $COUNT + 5 ] echo [$COUNT+5] echo "There are $((60j60j24j365)) seconds in a non–leap year." echo "ddd $((60*60*24*336)) " echo "ddd $((60*60*24*366))" x=23 y=37 echo $((2kx + 3ky)) echo $((2*x + 3*y)) echo $((2*$x + 3*$y)) days_in_month=(31 28 31 30 31 30 31 31 30 31 30 31) ‚‚set -A days_in_month 31 28 31 30 31 30 31 31 30 31 30 31 echo $((days_in_month[2])) echo $(($days_in_month[2])) man c man cc ps ((N=10)) echo $N echo "$N" echo "$((--N+3))" echo $N ((N=10 Z=0)) n=10 z=0 echo $((n || z=z+1)) echo $((n || ((z=z+1)) )) echo $z ((N=10,Z=0)) echo ((N+=)) echo ((n+=z)) echo ((n+=3)) echo ((n=3)) ((n+=3)) echo $n $z ((N=10)) ((Z=0)) echo $((N || ((Z+=1)) )) echo $((N || Z+=1)) ((N=10,Z=0)) Var1=$[2#0101] Var2=$[2#0110] echo "$Var1 and $Var2" ‚’echo $Var1 set set |pg let Var1=$[2#0101] ((Var1=2#0101)) echo $Var1 let Var1 = 2#0101 Var1 = 2#0101 let "Var1 = 5" echo $Var1 let "Var1=5" echo $Var1 "Var1=5" echo $(( Var1 & Var2 )) ((Var1=2#0101)) ehco echo echco $Var1 echo $Var1 let "Var1=2#0101]" let "Var1=2#0101" echo $Var1 echo $(( Var1 & Var2)) let "Var1=2#0101" let "Var2=2#0110" echo "$Var1 and $Var2" echo $(( Var1 & Var2 )) echo $(( Var1 && Var2 )) echo $(( Var1 | Var2 )) echo $(( Var1 || Var2 )) echo $(( Var1 ^ Var2 )) ‚Αecho $(( \!Var1 )) echo $(( Var1 < Var2 )) echo $(( Var1 > Var2 )) [[1=2]] [[1==2]] [[1 == 2]] echo [[1=2]] echo [[1!=]] echo "[[1!=]] " if [[1!=1]] then echo hi fi if [[1!=1]] then echo hithere; else ((1!=1)) echo $? echo $? [[1+2]] echo [[1+2]] echo $[[1+2]] [[1 -eq 1]] set a = 1 set b = 2 [[ a -eq b ]] [[ $a -eq $b ]] echo $? echo $a $b let a = 1 ((a=1;b=2)) a=1 b=2 echo $a $b [[ $a -eq $b ]] echo $? set -m variables list set set | pg echo $HOME ‚ζ [[ $(( ${#HOME} + 14 )) –lt ${#PWD} ]] [[ $(( ${#HOME} + 14 )) -lt ${#PWD} ]] echo $? [[ (–d bin && –f src/myscript.sh ]] && cp src/myscript.sh \ bin/myscript && chmod +x bin/myscript) || echo "Cannot make \ executable version of myscript"cat > xt [[ (–d bin && –f src/myscript.sh ]] && cp src/myscript.sh \ bin/myscript && chmod +x bin/myscript) || echo "Cannot make \ executable version of myscript" ls fruit cat fruit ans=[[ -z "$FRUIT" ]] cp fruit t vi t t vi t t vi t t ksh -x t ‚ωksh -x fruit vi fruit fruit vi fruit fruit vi fruit cp fruit t vi t t cat t t vi t t vi t t cat t cp fruit t vi t t echo $LINES $COLUMNS let LINES=3 t echo $LINES let COLUMNS=80 fruit vi t t cat t cat > fruit fruit vi fruit fruit ((LINES=2)) ((COLUMNS=10)) fruit vi t vi fruit fruit vi fruit fruit vi fruit fruit vi fruit fruit cat fruit fruit vi fruit fruit ksh -x fruit vi fruit fruit vi fruit fruit vi fruit fruit vi fruit fruit ‚2fruit cat fruit pri cat > fruit vi fruit fruit repeat $number; do repeat 3 ls -l -r -t ls -lrt touch -l touch -- -l ls ls -l ls -- -l ls ./-l ls -l ./-l cat > getopts1 vi getopts1 chmod 700 getopts1 getopts1 vi getopts1 getopts1 -t getopts1 -t . getopts -b getopts1 -b getopts1 -u getopts -u -- getopts1 -u -- cat > getopts2 vi getopts2;chmod 700 getopts2 getopts2 cat getopts2 ksh -x getopts2 vi getopts2 getopts2 getopts -b getopts2 -b getopts2 -t cat getopts2 ‚Zvi getopts2 getopts2 -t vi getopts2 getopts2 -t vi getopts2 getopts2 -t getopts2 t vi getopts2 getopts2 -t getopts2 -t 5 getopts2 -t . getopts -b getopts2 -b getopts2 -q vi getopts2 getopts2 -q getopts2 getopts2 : read MON\?"Enter month, day and year separated by spaces: " DAY YR echo $MON echo $DAY echo $YR pwd cat > names while read First Rest do print $Rest, $First done < names read line1 < names; print $line1; read line2 < names; print $line2 (read line1; print $line1; read line2; print $line2) < names ‚uexec 3< names read –u3 line1; print $line1; read –u3 line2; print $line2 read -u3 line1;print $line1; read -u3 line2; print $line2 exec 3<&- print xxx\c print xxx print "xxx\c" print -n xxx print \a print "\a" print "\v" print "\t" print xx\txx" " print "xxx\txx" print "abcd\befgh" print "xxx\cyyy" print "\08" print "\O8" print "\010" print "\x10" print "\x111" print "\0111" print "Columbus had 3 ships:\n\tThe Nina\n\tThe Pinta\n\tThe Santa Maria" print –R –n –p "This NEWLINE \nwill not be recognized" ; echo " done" ‚print -R -n -p "This NEWLINE \nwill not be recognized" ; echo " done" print "This NEWLINE \nwill not be recognized" ; echo " done" print -n xxxxx print -n "abc def\nefig" cat > mycp vi mycp chmod 700 mycp mycp mycp a b c d ls cat mycp t x cat x rm x cat > sortmerge vi sortmerge;chmod 700 sortmerge sortmerge sortmerge names names fun1() { echo fun1here } fun1 function fun2 { fun2here } fun2 function fun2 { echo fun2here } fun2 fun1 set set |pg functions cat > setenv chmod 700 setenv ‚«vi setenv setenv here=5 cat setenv ksh -x setenv 1 2 ksh -x setenv aa bb functions set | pg q function cat setenv setenv { unset setenv setenv { functions rm setenv setenv { setenv() { if [ $# -eq 2 ]; then eval $1="$2" export $1 else echo "Usage: setenv NAME VALUE" >&2 fi } functions setenv cc dd set |head set |pg sh ps whereis who alias -t w /usr/bin/who alias -t w who alias alias -t w who w alias alias -t v who v alias alias -t alias -t track ‚Ξalias -t alias alias t alias -t date alias alias date alias -x alias -t alias -t awk alias awk alias -t unset PATH echo $PATH ls -a .. cat ../.cshrc alias -t PATH=xxx alias -t alias alias -t alias alias z1 five alias z1 mail exit pwd alias z1 mail echo $PATH alias z1=mail alias alias -t alias -x z2=mail vi al_script ksh al_script vi al* chmod 700 al_script al_script z1 z2 vi al* al_script alias alias -x ksh alias exit alias alias z1 alias -t d=date ‚alias d alias ps alias -t d=date alias d d alias -t dd=date t ls alias alias -t alias -x alias b=date alias b b alias -t b=date b alias -t c=date c echo $c echo c d c e f alias -t cc=date cc alias alias -t dd=date dd alias -t ff=date ff alias ff alias ps echo $$ alias -t d=date d alias -x d=date alias d d ps echo $$ alias -t d=date d alias d alias alias -t d1=date d1 alias alias d=date d alias date alias alias -t f1=who ‚'f1 alias alias -t X1=date X1 alias kill -l whence grep whence pwd whence -v pwd whence -v func func(){ echo me } func whence -v func whence -v if man ksh trap echo HUP trap bindkey -v set EDITOR=vi echo $EDITOR EDITOR=vi echo $EDITOR # here i am typing ALONG here's more blah fc -e "${VISUAL:-${EDITOR:-vi}}" 853 blah mkdir films cd films touch casablanca city_lights dark_passage dark_victory modern_times ls cd .. cat films/dar cat films/dar cat films/dark_p ‚_cat films/dark_p cat films/dar* set set |pg EDITOR=emacs echo films/dark_ echo films/dar echo films/dar history "here is a multiline command" history csh ps echo $HISTSIZE $HISRFILE set | grep HIS vi ../.profile . ../.profile set | grep HI history exit history fc -l alias history fc -l 866 870 fc -e vi fc -l 866 870 which vi export FCEDIT=/bin/vi fc export FCEDIT=/bin/vi vi ../.profile fc -s vi ../.profile fc -e - vi ../.profile history fc -e - ‚yhistory clear hwllo value=10 new=4 set let "value=value*10+new" echo $let echo $value value=10 ((value=value*10+new)) echo $value value=10 let value=value*10+new echo $value value=10 echo * * x=* echo $x let COUNT=COUNT+1 "VALUE=VALUE*10+new" count=5 let COUNT=COUNT+1 "VALUE=VALUE*10+new" let count=1 let count=count+1 "value=value*10+new" set value=10 value = value * 10 + new value=value * 10 + new let "value=value * 10 + new" echo $value value=10 value = 10 ‚™((value=value * 10 + new)) echo $value echo there are ((5*5)) xxx echo there are $((5*5)) xxx [5*5] x=23 y=37 echo $((2*x +3*y)) echo $((2*$x + 3*$y)) n=10 z=0 echo $((N || ((Z+=1)) )) z=1 echo $((n || ((z=z+1) )) ) echo $((n || ((z+=1)) )) set echo $n history echo $((n || ((z+=1)) )) echo $ z exho echo $z echo $n z=0 n=10 echo $((n || ((z+=1)) )) echo $n $z echo $((15%7)) "Var1=2#0101" let "Var1=2#0101" let "Var2=2#0110" echo "$Var1 and $Var2" echo $(( Var1 & Var2 )) ‚Ίecho $(( Var1 && Var2 )) echo $(( Var1 | Var2 )) echo $(( Var1 || Var2 )) echo $(( Var1 ^ Var2 )) echo $(( \!Var1 )) echo $(( Var1 < Var2 )) echo $(( Var1 > Var2 )) echo ! echo !-1 !! history echo $! !$ echo [[1=1]] if [[1==1]] then echo hi fi echo [[1==1]] echo $? if [[1==1]]; then echo hi fi if [[1=1]]; then echo hi fi [[1-eq1]] [[ 1 -eq 1 ]] echo $? [[ 2 -eq 1 ]] echo $? HOME=abcdefg PWD=fffffffffff [[ $(( ${#HOME} + 14 )) –lt ${#PWD} ]] [[ $(( ${#HOME} + 14 )) –lt ${#PWD} ]] ‚Φ[[ $(( ${#HOME} + 14 )) -lt ${#PWD} ]] echo $? sh SENDIT="> /tmp/saveit" echo xxx $SENDIT cat /tmp/saveit man cc q q man ldd exit man ksh SENDIT="> /tmp/saveit" echo xxx $SENDIT cat /tmp/saveit vi f1 cat <> f1 cat f1 <> echo <> cat <> cat <> f1 cat <> f2 ls cat f2 rm f? touch f1 echo hi >> f1 cat f1 set | pg set noclobber cat yyy >> f1 echo yyy >> f1 cat f1 exit echo zzz >> f1 cat f1 ps set - set -C echo aaa>>f1 echo > f1 echo |>f1 echo bbb >| file1 ‚σcat file1 echo xxx >>! f1 cat f1 cat /dev/null > f1 cat /dev/null >| f1 cat f1 echo xxx >>!f1 cat f1 echo xxx >>! f1 cat f1 echo xxx >>| f1 ls -lt ls !* rm !$ rm !* ls cd / mkdir x mkdir backup && cp –r source backup ls backup cd cd / mkdir backup || echo "mkdir of backup failed" >> /tmp/log cat /tmp/log (mkdir backup && cp –r source backup) || echo "mkdir of backup \ failed" >> /tmp/log !cat cat /tmp/log true || false && false echo $? (true || false) && false echo $? ‚ false && false || true echo $? (false && false) || true echo $? n man ksh cd 13 pwd cd cd 13 ls cat names ls ls -l !?nam fc !?nam vi ../.profile . ../.profile !ca fc ka fc !ka fc !ca !ca history fc history !1053 !! fc !! fc -l history whatis history whereis history fc -l fc ca history cat names ls ls -l !?nam vi ../.profile . ../.profile !ca fc ka fc !ka !ca history history !1053 !! !! fc -l history :q history fc -l ca 1053 history ‚6aaaaa ;lakdsf ;laksdjf kadskl dskls bbbb kslkd sdllkdslk dslklds history fc -l aaa bbb fc -l bbb fc -l bbb bbb ls fc -e vi ls -l fc -l fc 1091 history fc 1091 ls fc -l fc -e - 1092 ls -l fc 1095 ls who date fc -l history who;date;ls history let a = 5 let a=5 echo $a b=5 echo $b alias ls='ls -F' ls alias echo - pwd cd ~- pwd cd / cd cd ~- pwd cd ~- pwd ls /bin ls /usr/openwin ls /usr/openwin/bin history xbin=/usr/openwin/bin ‚fecho ~xbin echo $xbin pwd cd 13 cat > rline fc vi rline chmod 700 rline rline=(grep "Alice*" names) vsy cat rline ps fc -e - -2 cat rline rline RANDOM echo $RANDOM echo $RANDOM%z rline = (echo a b c) rline=(echo a b c) ksh -x rline=(echo a b c) echo `pwd` echo $(pwd) cat rline z=$(wc -l) echo $z vi rline fc -l fc 1143 rline=(e ehistory history fc 1143 rline=(e einteger a a integer a set a=1.5 set rline rline names vi rline rline who ‚Žhistory rline names vi rline rline names cat rline vi rline rline names cat rline vi rline rline names cat rline vi rline rline names cat rline vi rline rline lists rline names vi rline fli rline names i rline rline names vi rline rline names vi rline rline names sed vi rline rline names vi rline man sed cat rline vi rline rline names vi rline rline names sed -n afjasd sed $[ $[ vi rline rline names cat rline vi rline rline names vi rline ‚»sed 55 sed 55p sed 's///' names sed 's/.//' names n=names set sed 's/.// ' $n history fc 1214 sed 's/.//' names fc sed 's/.//' $n cat rline fc -2 sed "s/$nn//" $n nn=a fc -2 sed "s/$nn//" $n cat rline echo $[ RANDOM % 5 + 1] echo $RANDOM echo $z z=3 vi rline rline names cat rline echo $RANDOM%z echo [5+2] echo [ 5 + 2 ] echo "[ 5 + 2 ]" echo ((15%7)) echo ((5+2)) man ksh ls c* pwd ls function count_down { typeset count count=$1 while ((count>0)); do echo "$count..." ((count=count-1)) done echo "Blast Off!" return } ‚άecho $count count=10 echo $count count_down 6 ls cat > quiz vi quiz chmod 700 quiz quiz quiz vi rline rline names cat rline vi rline rline names rline names cat rline cp rline works vi rline rline names vi rline cat rline set echo $[15+z] if [[$b=5]] echo hi if [[ $b -eq 5 ]] echo hi vi t t ksh -x t export b t rline =(grep "alice*" names) fc ksh -x rline =(g grline names cat names diff works rline cat works cat rline rline names history rline =(grep "alice*" names ‚fc rline =$(grep "alice*" names vi rline rline =(grep "Slice*" names) rline=(grep "Alice*" names) fc rline=\(grep "Alice*" names\) cat names grep "Alice*" names rline='(grep "Alice*" names)' cat names wc -l < (grep "Alice*" names) wc -l < names wc -l < 'grep "Alice*" names' wc -l < $(grep "Alice* names) wc -l < 'grep "Alice*" names' wc -l < names wc -l < 'grep "Alice*" names' . .profile ls -a pwd cd .. . .profile history pwd cd 13 rline=(grep "Alice*" names) ‚Bps history ls -l $(find . -name names -print) fc ls -l `find . -name names -print` touch README ls -l $find . -name README -size +$(echo $cat ./README | wc-c)c -print fc ls -l $find . -name README -size +$(echo $cat ./README | wc -c)c -print cd films vi README fc -l 1352 fc 1352 ls -l $find . -name README -size +$(echo $cat ./README | wc -c)c -print fc set -x $find . -name README -size +$(echo $cat ./README | wc -c)c -print fc -2 history fc 1357 ksh -x ls -l $find . -name README -size +$(echo $cat ./README | wc -c)c -print ‚Qls cd .. pwd ksh -x ls -l ksh -l ls -l ksh -x ls -l $(find . -name README -size +$(echo $(cat ./README | wc -c)c ) -print) pwd pwd scalar="a b c d" set +x fc -2 scalar="a b c d" echo $scalar set $scalar echo $1 set ${=scalar} echo $scalar set $scalar echo $scalar echo $1 echo $2 array=(a b c d) aa=(a b c d) cat > age_check fc vi age_check chmod 700 age_check age_check vi age* age_check age_check cat age_check age_check ls ~mark pwd ls /home/mark/{10,11,12,13) ‚tfc ls /home/mark/{10,11,12,13} pwd cat > to_upper fc vi to_upper chmod 700 to_upper to_upper cat > coproc_script fc chmod 700 coproc_script echo hi there | coproc_script ls cat coproc_script coproc_script pwd ls coproc_script ps coproc_script ps set pwd ps man ksh coproc coprocess apropos coprocess apropos co-process man vsig cat cop* cop* ps cat > makepath fc vi makepath makepath chmod 700 makepath makepath makepath a/b/c ls a pwd sh -x makepath ‚›cat which makepath set -x makepath a/b/c cat makepath cp makepath mp vi mp chmod 700 mp mp mp | more vi mp mp a/b/c vi coprocx_script vi coproc_script coproc_script abc cat co_Proc cat co_proc cat md pwd ls -ltr vi mp ls cp coproc_script orig vi coproc_script echo /home/alex | coproc_script fc -2 vi coproc_script coproc_script < names echo boo coproc_script pwd | coproc_script set +x cat coproc_script vi files ls cat files | coproc_script sh -x cat files | coproc_script ‚³ps pppppps ps echo $$ echo files | coproc_script cat coproc_script cat files | coproc_script to_upper |& jobd jon jobs kill fg jobs print me too read aa set cat coproc* coproc_script ls makepath cat makepath makepath makepath n/m ls n ls m ls -lt ls -ltr cat makepath set set | grep make set set |pg cat makepath chmod 600 makepath makepath ho(){ echo ho } ho < makepath set set | grep pg set | pg ho whatis ho whereis ho echo $ho functions ‚μcat makepath [[1 -eq 2]] [[ 1 -eq 2 ]] echo $? [[ 1 -eq 1 ]] echo $? print $[60*2] vi makedir vi make* makepath a/a ksh < makepath functions ps ls cat makepath makepath() { if [[ ${#1} -eq 0 || -d "$1" ]] then echo exit return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚όtypeset -f makepath m/n/o ls m ls m/n rm -r m vi makepath vi makepath cat makepath # this is a function # enter it at the keyboard, do not run it as a shell script makepath() { if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚typeset -f ksh typeset -f # this is a function # enter it at the keyboard, do not run it as a shell script makepath() { if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚typeset -f cat makepatth # this is a function # enter it at the keyboard, do not run it as a shell script makepath() { if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } exit ‚#exit pwd cat makepath setopt xtrace set -x if [[ -o x ]]; then print makefile $*"; fi fc if [[ -o x ]]; then print "makepath $*"; fi [[ -o x ]] if [[ -o xtrace ]]; then print "makepath $*"; fi echo $* pwd ls ls a cp makepath makepath2 vi makepath2 set +xtrace vi makepath2 cat makepath2 # this is a function # enter it at the keyboard, do not run it as a shell script set -x if [[ -o xtrace ]]; then print "makepath $*"; fi makepath() { if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚)cat makepath2 # this is a function # enter it at the keyboard, do not run it as a shell script set -x if [[ -o xtrace ]]; then print "makepath $*"; fi makepath() { if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚/typeset -f vi makepath2 cat makepath2 # this is a function # enter it at the keyboard, do not run it as a shell script makepath() { set -x if [[ -o xtrace ]]; then print "makepath $*"; fi if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚5makepath m/ n / o rm -rf m makepath m/n/o vi makepath2 print $* set ps makepath2 a/b/c makepath a/b/c rm -rf a makepath2 a/b/c ||pg ls makepath a/b/c >& hold fc makepath a/b/c > hold fc makepath a/b/c 3> hold pg hold ls hold more hold ls -l hold rm hold pwd cd ../13 ps exit pwd cd ../13 cat makefile2 cat makepath2 # this is a function # enter it at the keyboard, do not run it as a shell script ‚pmakepath2() { #turn on debugging set -x if [[ -o xtrace ]]; then print "makepath $*"; fi if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } typeset -f rm -rf a ‚smakepath2 a/b/c makepath2 a/b/c cat makepath2 vi makepath2 makepath2 a/b/c vi makepath2 makepath2 a/b cat makepath2 # this is a function # enter it at the keyboard, do not run it as a shell script makepath2() { #turn on debugging set -x if [[ -o xtrace ]]; then print "makepath2 $*"; fi if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath2 ${1%/*} || return 1 mkdir $1 return $? } ‚~makepath2 a/b/c set +x cat makepath # this is a function # enter it at the keyboard, do not run it as a shell script makepath() { if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚gmakepath d/e/f rm -rf a d vi makepath* cat makepath # this is a function # enter it at the keyboard, do not run it as a shell script makepath() { set -x if [[ -o xtrace ]]; then print "makepath2 $*"; fi if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚‹makepath a/b/c vi makepath.out1 makepath /a/b/c vi makepath.out2 fc vi makepath.out2 cat makepath.out1 rm makepath2* rm *out? vi makepath ls -ltr rm -rf a m makepath a/b/c rm -r a mkdir \\\ q makepath a/b/c > hold rm -rf a makepath a/b/c 2> hold rm -rf a makepath a/b/c 2> hold 2>&1 rm -r a makepath a/b/c 2>hold 1>&2 cat hold makepath /a/b/c 2>hold2 1>&2 cat hold2 ls -ltr ls \q ftp speedy cat hold1 cat hold man ksh sccs rcs man sccs man rcs cat > sccsname ‚‘sccsname() { _dir=$(dirname $1) _base=$(basename $1) echo $_dir/s.$_base } ls a echo $(sccsname a/b/c) cat > sccs vi sccs cat sccs cat sccs wc sccs `head sccs` pg sccs vi makepath vi sccs chmod 700 main main ls -ltr diff xmakepath makepath cat makepath makepath() { # comment out the next two lines to turn off debugging #set -x #if [[ -o xtrace ]]; then print "makepath $*"; fi if [[ ${#1} -eq 0 || -d "$1" ]] then return 0 # Do nothing fi # Check if arg is a simple path component: if [[ "${1%/*}" = "$1" ]] then mkdir $1 return $? fi makepath ${1%/*} || return 1 mkdir $1 return $? } ‚ΐtypeset +f ls -ltr cat sccsname sccsname() { _dir=$(dirname $1) _base=$(basename $1) echo $_dir/s.$_base } cat checkargs checkargs() { if [[ $# != 2 ]] then print -u2 "usage: checkin " exit 1 fi if [[ ! -d $1 ]] then print -u2 "$1: Not a directory" exit 1 fi # Check second argument if [[ -a $2 && ! -d $2 ]] then print -u2 "$2: Not a directory" exit 1 fi # Check that neither argument is a prefix of the other if [[ $1 = $2* || $2 = $1* ]] then print -u2 "Cannot create one hierarchy below or above the other" exit 1 fi return 0 } ‚Ζls -lt cat max ls -ltr main typeset -f typeset +f man ksh ls -ltr export checkargs sccsname makepath main typeset +f env ls -lt env | grep checkargs env |pg ls -ltr sccs chmod 700 sccs sccs ls sccs xmakepath a/b/c mkdir dir touch dir/a sccs dir /a/b sccs dir d/e/f ls d/e/f ls d ls d/e ls d/e/f ls ls dir ls dir touch dir/b,c ;s ls ls 13 ls a/b/c ls a ls a/b sccs dir g/h/i ls dir ls g/h/i ls -a g/h/i ls sccsname cat sccsname touch a/b/c/s.new pg sccs ‚υls -ltr cat err* admin whereis admin vi ../.profile . ../.profile ls -ltr sccs dir a/b/c cat err* admin set path echo $path . ../.profile echo $path echo $PATH /usr/ccs/bin/admin/admin fc /usr/ccs/bin/admin admin rehash admin . \ source . ../.profile cat ../.profile j eh echo $PATH export PATH admin man ksh ENV=~mark/.profile echo $ENV ksh ls -ltr sccs sccs dir g/h/i ls -lt ls -ltr date cat err* admin echo $PATH /usr/ccs/bin/admin vi ../.profile ‚$history rm -rf a d g sccs dir a/b/c ls a/b/ ls a/b/c ls -lt ls -ltr cat err* admin echo $PATH source ../.profile fc . ../.profiel fc . ../.profiel . ../.profile admin ls rm -rf a sccs dir a/b/c j ./sccs dir a/b/c ls -lt cat err* ls a/b/c ls dir ls j jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj n\ mv sccs sccs,1 fc mv sccs sccs.1 ls -ltr rm -rf a rm main checkargs sccsname xmakepath cat > quiz vi quiz chmod 700 quiz ls /usr/games ls /usr ls /usr/games mkdir /usr/games/lib ‚+su quiz vi quiz ksh -x quiz set -x set echo hi quiz ls vi makepath quiz quiz set +x vi quiz quiz vi quiz quiz vi quiz vi quiz quiz vi quiz cat x ask() { set -A choices exec 3<$1 read -u3 ques || exit 2 read -u3 num_opts || exit 2 index=0 while (( index < num_opts )); do read -u3 next_choice || exit 2 choices=($choices $next_choice) (( index += 1 )) done typeset +f ‚Dvi x cat x ask() { set -A choices exec 3<$1 read -u3 ques || exit 2 read -u3 num_opts || exit 2 index=0 while (( index < num_opts )); do read -u3 next_choice || exit 2 choices=($choices $next_choice) (( index += 1 )) done } vi x vi x man ksh choices=(1 2 3 4) choices=( 1 2 3 4 ) choices= 1 2 3 4 choices=1 2 3 4 set -A one 1 two 2 three 3 four 4 set ‚Rvi quiz quiz ls /usr/lib/games ls /usr/games/lib mv /usr/games/lib /usr/games/lib/quiz su mv /usr/games/lib /usr/games/lib/quiz quiz su quiz quiz ksh -x quiz pg quiz vi quiz set -A subjects $(ls) ksh -x set -A subjects $(ls) echo $(ls) ff ls ?l ls ?l ls -- -l ls -l -- -l rm -- -l ls ls \\q ls -l *q ls -ld *q rm *q rmdir *q ls echo $(ls) set -A choices $(ls) set vi quiz quiz ps ps -u mark kill -9 27004 sh -x quiz vi quiz set set | grep sub set 2| grep sub ‚|quiz su quiz vi quiz quiz man ksh echo $(( a+=1)) echo $(( a=a+1 )) a=5 fc -2 echo $(( a=a+1 )) echo $((a=a+1)) fc -e - echo $((a=a+1)) vi quiz echo (( a = a + 1 )) vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz ps -ef | grep quiz kill -9 quiz kill -9 27129 quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz qyu ' q qyu quiz quiz quiz vi quiz quiz quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz ‚°vi quiz quiz vi quiz jj man ksh quiz vi quiz quiz vi quiz quiz vi quiz quiz index=5 index = $((index+1)) fc index = $(( index + 1 )) fc index = $(( $index + 1 )) g=44 g = $(( g + 1 )) g=$(( g + 1 )) echo $g vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz ‚ζvi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz vi quiz quiz vi quiz set print one print $one print $one[*] print $one[\*] print one ptin print $one[4] print one[4] print "one[*]" print "one[@]" set -A bb 1 2 3 4 echo $aa[*] echo $bb[*] vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz quiz quiz set echo $one[0] ps exit cd 13 ls cd ../13 ls set set -A a one two three four echo $a echo $a[3] set -A NAMES alex helen jenny scott ‚echo $NAMES echo ${NAMES[2]} vi quiz quiz history vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz quiz vi quiz man ksh chmod 700 a a cat a vi a a vi a a vi a a vi a a vi a a vi a a vi a a vi a a vi a a vi a b=5-4 echo $b a vi a a vi a a vi a a vi a a vi a a vi a a vi a a vi a a vi a a vi a a vi a man zsh typeset set typeset cat typeset -t set set ‚dhistory typeset -t set man ksh vi x chmod 700 b b mop=hello b echo $b echo $mop set -k b mop=goodby b mop=xxxx b b mop=yyy b set -o vi cdebwnow moar set +o vi abckdrehhhll set vi abcd man admin admin . ~/.profile admin man admin fc man admin mkdir 21 cd 21 admin –imenu1 s.menu1 admin -imenu1 s.menu1 fc admin -imenu1 s.menu1 man admin ls sccs -n man sccs man admin fc -l which admin admin -imenu1 s.menu1 admin -x admin -n admin -nmenu1 ‚’admin -n menu1 admin -n admin man admin man at at -x atq man atq man at atrm fc -2 man at at now date at now sat man at at 2am at 2am at -f pr_tonight touch pr_tonight at -f pr_tonight 2am at 2am < pr_tonight at -l at -r 892302139.a at -l mail mail man at at -l at -r 89218801.a at -l at -r 892198801.a touch cmdfile at -f cmdfile 1530 +1 week at 7pm Friday at 2am at -f pr_tonight 2am mkdir awk cd awk cat > cars vi cars vi cars awk '/chevy/' cars ‚Όcat cars 5 115 450 honda accord 9 awk '{print $3, $1}' cars awk '/chevy/ {print $3, $1}' cars awk '/h/' cars awk '$1 ~ /h/' cars awk '$1 ~ /^h/' cars awk '$2 ~ /^[tm]/ {print $3, $2, "$" $5}' cars awk '$3 ~ /5$/ {print $3, $1, "$" $5}' cars awk '$3 == 75' cars awk '$5 <= 3000' cars awk '$5 >= "2000" && $5 < "9000"' cars awk '$5 >= 2000 && $5 < 9000' cars awk '/volvo/ , /fiat/' cars awk '/chevy/ , /ford/' cars cat > pr_header cat pr_header awk –f pr_header cars awk -f pr_header cars ‚Πcat > pr_header2 fc vi pr_header2 awk -f pr_header2 cars awk '{print length, $0}' cars | sort awk 'length > 23 {print NR}' cars awk 'NR == 2 , NR == 4' cars awk 'END {print NR, "cars for sale." }' cars cat > separ_demo cat separ_demo awk -f separ_demo cars cat > ofs_demo awk -f ofs_demo cars cat > printf_demo vi printf_demo awk -f printf_demo cars cat > redirect_out awk -f redirect_out cars cat chevfile cat > summary vi summary awk -f summary cars cat summary vi summary ‚ηfc  vi summary awk -f summary cars vi summary cat cars cat cars vi summary awk -f summary cars vi summary fc -2 awk -f summary cars cat summary awk -f summary cars vi summary awk -f summary cars vi summary awk -f summary cars vi summary awk -f summary cars cat summary vi summary vi -v cat summary awk -f summary cars grep 'mark' /etc/passwd cat > find_uid cat find_uid vi find_uid awk -f find_uid /etc/passwd cat /etc/passwd vi find_uid awk -f find_uid /etc/passwd ‚ cat > find_uid awk -f find_uid /etc/passwd cat > price_range vi price_range awk -f price_range cars cat > awk ' {manuf[$1]++} END {for (name in manuf) print name, manuf[name]} ' cars | sort cat > manuf vi manuf chmod 700 manuf manuf cat > manuf.sh vi manuf.sh manuf.sh chmod 700 manuf.sh manuf.sh manuf.sh 1 cars manuf.sh 3 cars cat > word_usage vi word_usage ls word_usage price_range chmod 700 word_usage fc -2 -e - word_usage price_range cat > word_count vi word_usage ‚ ls -ltr vi word_count word_count chmod 700 word_count word_count cat word_count man tr > tr.man word_count tr.man | tail cat word_count vi word_count word_count tr.man | tail fc word_count tr.man | pg cat > report vi report chmod 700 report report cars cat > numbers vi numbers cat > tally cat > tally vi tally chmod 700 tally tally cat tally.out cat > /etc/passwd bill::102:100:ext 123:/home/bill:/bin/sh roy:x:104:100:ext 475:/home/roy:/bin/sh tom:x:105:100:ext 476:/home/tom:/bin/sh ‚ :lynn:x:166:100:ext 500:/home/lynn:/bin/sh mark:x:107:100:ext 112:/home/mark:/bin/sh sales:x:108:100:ext 102:/m/market:/bin/sh anne:x:109:100:ext 355:/home/anne:/bin/sh toni::164:100:ext 357:/home/toni:/bin/sh ginny:x:115:100:ext 109:/home/ginny:/bin/sh chuck:x:116:100:ext 146:/home/chuck:/bin/sh neil:x:164:100:ext 159:/home/neil:/bin/sh rmi:x:118:100:ext 178:/home/rmi:/bin/sh vern:x:119:100:ext 201:/home/vern:/bin/sh bob:x:120:100:ext 227:/home/bob:/bin/sh janet:x:122:100:ext 229:/home/janet:/bin/sh ‚ Fmaggie:x:124:100:ext 244:/home/maggie:/bin/sh dan::126:100::/home/dan:/bin/sh dave:x:108:100:ext 427:/home/dave:/bin/sh mary:x:129:100:ext 303:/home/mary:/bin/shcat > passwd cat > passwd vi passwd head -3 /etc/passwd grep mark /etc/passwd vi passwd cat /etc/group vi passwd cat passwd cat pass* cat > passwd_check vi passwd_check passwd_check chmod 700 passwd_check passwd_check avi passwd_check vi passwd_check passwd_check cat passwd vi passwd passwd passwd_check cat > list_cars ‚ `vi list_* chmod 700 list_cars list_cars vi list_cars list_cars vi list_cars list_cars list_cars list_cars awk {print $3, $1} cars awk '$3 >= 83 {prinnt $1}' cars awk '/chevy/ print $3, $1' cars awk '/z/' cars awk '{$3}' cars awk '{$3 " made by " $1}' cars ls print_cars cat > print_cars vi print_cars chmod 700 print_cars print_cars cat print_cars vi print_cars print_cars cat print_cars man awk vi print_cars history awk -f print_cars cars vi print_cars fc -l fc 2427 -e - ‚ fc -e - 2427 awk -f print_cars cars vi print_cars awk -f print_cars cars cat print_cars cat > print_cars2 vi print_cars2 vi print_cars awk -f print_cars2 cars vi *2 awk -f print_cars2 cars vi print_cars2 awk -f print_cars2 cars ls rm tr.man cd .. pwd cd .. mv 21 .. cd .. ls cd 21 ls man cal cal 8 1999 man cat pwd touch memo letter vi letter cat > memo cat memo letter > letter man cd cat letter apropos display xlock ‚ ΐcsh vi xx ls -l xx chmod +l xx ls -l xx vi xx rm xx pg /etc/system ls chown mark memo chown mark root chown root memo ls -l memo who am i ls -l memo