Transcription of Bash Guide for Beginners 中文版 - evilcos.me
1 bash 1/91 bash Guide for Beginners Machtelt Garrels <tille wants no spam _at_ xalasys dot com> Version Last updated 20050905 Edition by Wei Wang <wangwei0609 at gmail dot com> Version Last updated 20060105 Edition bash 2/91 ..2 1..2 2..2 3..2 4..2 5..2 6..2 7..2 8..2 9..2 10..2 bash bash ..2 shell ..2 shell ..2 shell ..2 bash ..2 bash GNU bash ..2 ..2 ..2 Shell ..2 ..2 ..2 Shell ..2 ..2 ..2 ..2 ..2 ..2 bash ..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 Shell ..2 ..2 bash ..2 ..2 ..2 bash 3/91 ..2 ..2 bash ..2 Shell ..2 ..2 ..2 shell ..2 ..2 ..2 ..2 ..2.
2 2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 ANSI C ..2 Shell ..2 ..2 ..2 ..2 Shell ..2 ..2 ..2 ..2 Word splitting ..2 ..2 ..2 ..2 ..2 bash ..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 Basic versus ..2 bash 4/91 Grep ..2 Grep?..2 Grep ..2 bash ..2 ..2 classes ..2 ..2 ..2 GNU SED ..2 ..2 sed?..2 sed ..2 ..2 pattern ..2 pattern ..2 ..2 sed ..2 ..2 sed ..2 ..2 ..2 ..2 GNU AWK ..2 gawk ..2 gawk?..2 Gawk ..2 ..2 ..2 ..2 ..2 Gawk ..2 Gawk ..2 ..2 ..2 ..2.
3 2 ..2 printf ..2 ..2 ..2 ..2 if ..2 ..2 bash 5/91 ..2 if ..2 ..2 if/then/elif/else ..2 ..2 ..2 exit case ..2 ..2 ..2 ..2 ..2 ..2 ..2 echo ..2 ..2 read ..2 ..2 ..2 ..2 ..2 ..2 ..2 for ..2 ..2 ..2 while ..2 What is it?..108 ..2 ..2 until ..2 What is it?..111 ..2 ..2 I/O ..2 ..2 ..2 Break continue ..2 ..2 Making menus with the select built ..2 ..2 What does it do?.. bash 6/91 ..2 ..2 ..2 ..2 ..2 assignment of ..2 declare ..2 ..2 ..2 Dereferencing the in an ..2 ..2 ..2 Operations on ..2 Arithmetic on.
4 126 ..2 ..2 ..2 ..2 ..2 ..2 ..2 ?..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 ..2 kill ..2 ..2 ..2 bash ..2 ..2 ..2 ..2 A Shell ..2 ..2 B GNU ..2 bash 7/91 1. HOWTO ABS bash UNIX/Linux UNIX UNIX 2. UNIX UNIX shell shell UNIX Linux man / / 3.
5 Beginners Guide / bash 8/91 1. 4. Revision 2005 09 05 Revised by: MG Corrected typos in chapter 3, 6 and 7, incorporated user remarks, added a note in chap7. Revision 2005 03 01 Revised by: MG Minor debugging, added more keywords, info about new bash , took out blank image. Revision 2004 12 06 Revised by: MG Changes because of new domain, minor corrections. Revision 2004 10 18 Revised by: MG Debugging, added a couple of notes in chap9, replaced screenshots with screen sections. Corrected some typos. Revision 2004 07 09 Revised by: MG Added tracer image 1x1 pixel , added textobjects for all pictures, fixed wrong links in index, made signal list more clear. Revision 2004 06 15 Revised by: MG Added index, more markup in screen sections.
6 Revision 2004 05 22 Revised by: MG Last read through before going to press, added more examples, checked summaries, exercises, cleaned up introduction. Revision 2004 04 27 Revised by: TM Initial release for LDP; more exercises, more markup, less errors and abuse; added glossary. Revision beta 2003 04 20 Revised by: MG Pre release 5. bash 9/91 Hans Bol, one of the groupies Mike Sim, remarks on style Dan Richter, for array examples Gerg Ferguson, for ideas on the title Mendel Leo Cooper, for making room # , for keeping my feet on the ground Frank Wang, for his detailed remarks on all the things I did wrong ; ) Tabatha Marshall 6. mail <tille wants no spam _at_ xalasys dot com> 7.
7 8. 9. 10. bash bash Sed Awk bash 10/91 bash bash Shell GNU bash shell bash Shell shell shell UNIX shell Shell Shell Shell Shell (see Section ) shell shell shell shell UNIX shell sh Bourne Shell shell UNIX UNIX shell shell UNIX Linux bash Bourne Again shell GNU shell Linux bash shell shell Bourne shell , bash sh sh bash bash csh C shell C tcsh Turbo C shell a superset of the common C shell ksh the Korn shell UNIX Bourne shell /etc/shells Linux shell mia:~> cat /etc/shells /bin/ bash /bin/sh bash 11/91 /bin/tcsh /bin/csh shell /etc/passwd mia mia:L2 NOfqdlPrHwE:504.
8 504:Mia Maya:/home/mia:/bin/ bash shell shell PATH shell shell shell mia:~> tcsh [mia@post21 ~]$ bash bash GNU Shell GNU (GNU's Not UNIX) UNIX UNIX bash sh shell Korn shell (ksh) and C shell (csh) IEEE POSIX Shell sh shell 2 64 bash sh GNU bash bash shell bash shell set bash bash H> bash bash shell shell ` login` Shell shell shell /etc/profile ~/.
9 Bash_profile,~/.bash_login ~/.profile: bash 12/91 ~/.bash_logout bash shell shell shell ~/.bashrc ~/.bash_profile if [ Hf ~/.bashrc ]; then . ~/.bashrc; fi if shell BASH_ENV PATH sh bash sh POSIX /etc/profile ~/.profile ENV POSIX set set Ho posix posix bash bash POSIX shell POSIXLY_CORRECT ENV bash 13/91 rshd ~/.bashrc r rlogin,telnet,rsh,rcp SSH UNIX UID ID EUID shell shell shell bash bash shell shell bash bash Forking exec forkHandHexec UNIX Linux , 1 init.
10 Bootstrapping fork bash 14/91 Shell shell shell bash 3 bash fork bash shell shell shell shell shell shell Shell Shell Shell shell touch file1 file2 file3 shell ls | more gunzip | tar xvf H Shell Shell Shell Shell shell Shell shell shell declare bash 15/91 unset Shell Shell shell shell Shell bash shell Hc Hs shell shell PATH shell 1.