Script started on Wed Mar 22 09:53:24 2000 $ #file name generation -  > is interpreted y by the shell $ #fil   wildcards -> inter     is interpreted by the command $ #regex stuff work  s on  wiht t    th the shell.                                  #chmod on each file ont     in the current dir? now we need to do some patter  n matchig  ing, which are not regex st $ # regex this stuff $ # ?          *.          .* * $ #   #file gern  nerating characters will not produce a dot file!!!!! $ banner FileName Generating Chars ####### # # # # # ###### ## # ## # # ###### # # # # # # # # # ## ## # ##### # # ##### # # # # # # ## # ##### # # # # # # # ###### # # # # # # # # ## # # # # # # # ###### ###### # # # # # # ###### ##### # # ###### # # ###### ##### ## ##### # # # #### # # ## # # # # # # # # ## # # # # #### ##### # # # ##### # # # # # # # # # # # # # # # # # ##### ###### # # # # # # ### # # # # ## # # # # # # # # ## # # ##### ###### # # ###### # # # # # # # # #### ##### # # # # ## ##### #### # # # # # # # # # ###### # # # # #### # # # ###### ##### # # # # # # # # # # # ##### # # # # # # #### $ #ls abc? will print ab        list all files that start wh ith abc foll      in the name $ #if file name generation cannot find a match it will echo the string $ # ls [abcd]d would find ad, bd, cd, dd $ # ls [!abc]] d would find all 2 letter files but ones that start with                                tha  t end with d  , but do not start with abc   b  , b, or c $ find      # ls [AZ -Za-Z z] wi  would list      find any on  1 letter file name $ # ls [!A-Z]?? would find a 2 char word           3 char work d that does not begin with a cap letter or a d dot $ # ls * finda s all but             would find all files exc   that      whos name is 0 or more chars, but does nto st      not start with . co  dot $ $ when    #when doing a rm, use     re  dont u   't n use rm -r *, but do use rm -ir * to be prompted $ #!!!!!!!!!!!!!!!!!!!!!!!read the line ab bove!!!!!!!!!!!!!!!!!!!!!!!!1!  !!!! $ $ #finda l    all files with 5chars --> ls ????? .???? $ # ? will not pick up the . files       dotfiles $ # find all files that begin with dot, excpet dot --> ls .?* $ # find all files that begin with dot, excpet dot and dotdot --> .{ [!.} [ ]* $ $ #note, try man ascii to see all the cha   ascii assignments $ $ sp  #specal chars             banner quoting #### # # #### ##### # # # #### # # # # # # # # ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # ### # # # # # # # # # ## # # ### # #### #### # # # # #### $ #specail chars !#$^*[] $ echo the \\ the \ $ echo the \\ \! the \ ! $ echo the pse   special chars \\ \! \# \$ \^ \* \+ \[ \] the special chars \ ! # $ ^ * + [ ] $ echo this is not a               "this is not a                this is not special \thsi  is this is not special this $ echo this is not a f                 line feed is taken as literal \ > " > > $ #single quote is    rem moves the specai  ial meaninf   g of everythin in the p quotes. $ echo 'this is *****' this is ***** $ echo 'this is a con        isnt'    \t 't a contraction' > " ' this isn a contraction $ echo this isn' \t'  't a contraction this isn't a contraction $ # ' `` is the same s as $() $ echo "the     they are all        're all here, \\, ', \" " they're all here, \, ', " $ # under double quotes, single quote looses plecail         special meaning, backslack retains   meaning. $ cut -c 1-4 funfile 10.0 A ba A bu A co A co Afte All An e Anot Any Any Any Any APL As f As o Aski Avoi Base Bewa Brea CChh Comp Comp Comp Disc Hack Hard If a If a If a Mach Manu Mayb One Real Reme Supe Syst The The The The The The The Ther Thos To e To e Unpr Vari You You $ cut -f2 -d" > " funfile times bad bug computer computer a computers elephant megabytes given nitwit program sufficiently is far of whether temporary 8 of are are have The a a a Does Writer's Computer if programmers the going computer determined generation steady value world world are who err err performance: won't; might never $ cut -f2 -d" ^J" funfile $ $ exit script done on Wed Mar 22 15:47:50 2000 $ $ $ $ $ $ $ ^VScript started, file is typescript Script done due to signal 1, file is typescript $ # you can put many things on one line $ # cat f2 means cat f1 to the screen, and reqrite over f2 $ # cmd 2> file means copy standard error to file $ $ #filters (ie cat) $ wc funfile 108 527 3081 funfile $ # wc=wordcount, where 108 lines, 524 words, 3081 chars on funfile $ # wc is a filter, since it takes and returns $ # sort -ru to sort by reverse $ $ # sort -n does newmeric. -d gives a dictionary sort $ # sort by second word $ # sort -u -k2 -t " " funfile $ sort suppressing duplicate lines (-u) < $ # sort -u -k2,1 -t " " funfile menas sort suppressing duplicate lines (-u) $ # sorting by 2nd field (-k2) $ # don't list any lines duplicated in position 1 (,1) $ # -t " $ # separtate fields with " " delimeter (-t " ") $ # on the file funfile $ $ # grep : -c = a count of matching lines $ # -i = ignore upper and lower case $ # -n = show line numbers in front of each line $ # -v = list all lines except those matching the pattern $ # -l = list only the file names $ # -f = grep will use a list of pattern that are located in a fie for the grep $ # -e = grep will use the following patterns for the grep $ $ hostname zuni $ 393 cut -c 1-4 funfile 394 cu 395 cut -f2 -d" ^J" funfile 396 cut -f2 -d" ^J" funfile $ $ ^VScript started, file is typescript Script done due to signal 1, file is typescript $ $ $ ekj;lasd sh: ekj: not found. sh: lasd: not found. $ Script started, file is typescript Script done due to signal 1, file is typescript [408] user17 $ date |cut -c1-3 |tr "[:lower:]" "[:upper:]" WED pr -n@5 funfile Mar 21 15:38 2000 funfile Page 1 1@I just like it when problems are solved. 2@Don't blame me. Phil's doing back-ups. 3@You don't have to call Like it anyway 4@"90% of this game is about half mental" : Yogi Berra 5@Yes, I AM out to get you 6@"It was hell," recalls former child. 7@The Divinity 2000 supermicro comes with virtuous memory - like it or not 8@No problem. ls |pr -5 -t tee a file to send file to a pipe and file at the same time. grep home /etc/passwd |pr -h "USER Accounts" ls -F $HOME |pr -3 | tee homedir | lp man banner |newform | lp # newform unformats the man so it can be formated var1=$(date |cut -c1-3) Script started on Wed Mar 22 16:19:27 2000 $ ls README.exrc date funfile.copy mod1.c myvifile root_file abcdefXlmnop day1 funfiledir mod2.c names scaveng.README abcdefYlmnop day2 grape mod3.c names.cp scavenger apple day3 herfile mod5.1 newdir test1 backup dead.letter infinite mod5.3 newfile testlinking banana f1 is mod5.4 note tree class f2 lemon mod5.dir orange tst color1 file.1 libtest.c myfile ourfile typescript color2 file.2 lime myprog part1.c user17 color3 filegen ls.out myprog.c part2.c vi.tst color4 frankenstein math.c myprog.f peach who.out color5 fruit math.f myprog.p prog1 xdbtest.c color6 fun.vi math.p mytrap prog2 yourfile dat3 funfile memo mytrap2 remind $ exit script done on Wed Mar 22 16:19:32 2000