📄 bash.ps
字号:
E F1(else)2.5 E F2(list)2.5 E F0 2.5(;])C F1<8c>A F0(The)144 470.4 Q F1(if)2.978 E F2(list)3.068 E F0 .478(is e)3.658 F -.15(xe)-.15 G 2.978(cuted. If).15 F .478(its e)2.978 F .478(xit status is zero, the)-.15 FF1(then)2.978 E F2(list)2.978 E F0 .478(is e)2.978 F -.15(xe)-.15 G2.978(cuted. Otherwise,).15 F(each)2.978 E F1(elif)2.977 E F2(list)2.977E F0 1.087(is e)144 482.4 R -.15(xe)-.15 G 1.087(cuted in turn, and if its e).15 F 1.087(xit status is zero, the corresponding)-.15 F F1(then)3.587 E F2(list)3.587 E F0 1.088(is e)3.588 F -.15(xe)-.15 G 1.088(cuted and the).15 F.104(command completes.)144 494.4 R .103(Otherwise, the)5.104 F F1(else)2.603 E F2(list)2.603 E F0 .103(is e)2.603 F -.15(xe)-.15 G .103(cuted, if present.).15 F .103(The e)5.103 F .103(xit status is the e)-.15 F .103(xit sta-)-.15 F(tus of the last command e)144 506.4 Q -.15(xe)-.15 G(cuted, or zero if no condition tested true.).15 E F1(while)108 523.2 Q F2(list-1)2.5 E F0(;)A F1(do)2.5 E F2(list-2)2.5 E F0(;)A F1(done)2.5 E(until)108 535.2 Q F2(list-1)2.5 E F0(;)A F1(do)2.5 E F2(list-2)2.5 E F0(;)A F1(done)2.5 E F0(The)144 547.2 Q F1(while)3.45 E F0.95(command continuously e)3.45 F -.15(xe)-.15 G .95(cutes the list).15F F2(list-2)3.45 E F0 .95(as long as the last command in the list)3.45 FF2(list-1)144 559.2 Q F0 .205(returns an e)2.705 F .205(xit status of zero.)-.15 F(The)5.205 E F1(until)2.705 E F0 .205(command is identical to the)2.705 F F1(while)2.705 E F0 .205(command, e)2.705 F(xcept)-.15 E .599(that the test is ne)144 571.2 R-.05(ga)-.15 G(ted;).05 E F2(list-2)3.189 E F0 .599(is e)3.119 F -.15(xe)-.15 G .6(cuted as long as the last command in).15 F F2(list-1)3.19E F0 .6(returns a non-zero)3.1 F -.15(ex)144 583.2 S .205(it status.).15F .205(The e)5.205 F .205(xit status of the)-.15 F F1(while)2.705 E F0(and)2.705 E F1(until)2.704 E F0 .204(commands is the e)2.704 F .204(xit status of the last command)-.15 F -.15(exe)144 595.2 S(cuted in).15E F2(list-2)2.5 E F0 2.5(,o)C 2.5(rz)-2.5 G(ero if none w)-2.5 E(as e)-.1 E -.15(xe)-.15 G(cuted.).15 E F1(Copr)87 612 Q(ocesses)-.18 E F0(A)108 624 Q F2(copr)3.712 E(ocess)-.45 E F0 1.212(is a shell command preceded by the)3.712 F F1(copr)3.713 E(oc)-.18 E F0(reserv)3.713 E 1.213(ed w)-.15 F 3.713(ord. A)-.1 F 1.213(coprocess is e)3.713 F -.15(xe)-.15 G 1.213(cuted asyn-).15 F .575(chr\onously in a subshell, as if the command had been terminated with the)108 636 R F1(&)3.074 E F0 .574(control operator)3.074 F 3.074(,w)-.4 G.574(ith a tw)-3.074 F(o-)-.1 E -.1(wa)108 648 S 2.5(yp).1 G(ipe established between the e)-2.5 E -.15(xe)-.15 G(cuting shell and the coprocess.).15 E(The format for a coprocess is:)108 664.8 Q F1(copr)144 681.6 Q(oc)-.18 E F0([)2.5 E F2 -.27(NA)C(ME).27E F0(])A F2(command)2.5 E F0([)2.5 E F2 -.37(re)C(dir).37 E(ections)-.37E F0(])A .922(This creates a coprocess named)108 698.4 R F2 -.27(NA)3.422 G(ME).27 E F0 5.922(.I)C(f)-5.922 E F2 -.27(NA)3.422 G(ME).27 E F0.923(is not supplied, the def)3.422 F .923(ault name is)-.1 F F2(COPR)3.423 E(OC)-.4 E F0(.)A F2 -.27(NA)5.923 G(ME).27 E F0 .64(must not be supplied if)108 710.4 R F2(command)3.14 E F0 .64(is a)3.14F F2 .64(simple command)3.14 F F0 .64(\(see abo)3.14 F -.15(ve)-.15 G.64(\); otherwise, it is interpreted as the \214rst).15 F -.1(wo)108722.4 S .163(rd of the simple command.).1 F .163(When the coproc is e)5.163 F -.15(xe)-.15 G .163(cuted, the shell creates an array v).15 F.163(ariable \(see)-.25 F F1(Arrays)2.663 E F0(GNU Bash-4.2)72 768 Q(2010 December 28)135.965 E(6)190.955 E 0 Cg EP%%Page: 7 7%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\))-.35 E(belo)108 84 Q .512(w\) named)-.25 F/F1 10/Times-Italic@0 SF -.27(NA)3.012 G(ME).27 E F0 .512(in the conte)3.012 F .511(xt of the e)-.15F -.15(xe)-.15 G .511(cuting shell.).15 F .511(The standard output of)5.511 F F1(command)3.211 E F0 .511(is connected)3.781 F .81(via a pipe to a \214le descriptor in the e)108 96 R -.15(xe)-.15 G .811(cuting shell, and that \214le descriptor is assigned to).15 F F1 -.27(NA)3.311 G(ME).27 E F0 3.311([0]. The)B .717(standard input of)108 108R F1(command)3.417 E F0 .716(is connected via a pipe to a \214le descriptor in the e)3.987 F -.15(xe)-.15 G .716(cuting shell, and that \214le).15 F .702(descriptor is assigned to)108 120 R F1 -.27(NA)3.202 G(ME).27 E F03.202([1]. This)B .703(pipe is established before an)3.203 F 3.203(yr)-.15 G .703(edirections speci\214ed by the com-)-3.203 F 1.184(mand \(see)108 132 R/F2 9/Times-Bold@0 SF(REDIRECTION)3.684 E F0(belo)3.434 E 3.684(w\). The)-.25 F 1.183(\214le descriptors can be utilized as ar)3.684 F 1.183(guments to shell commands)-.18 F 1.796(and redirections using standard w)108 144 R 1.796(ord e)-.1 F 4.297(xpansions. The)-.15 F 1.797(process ID of the shell spa)4.297 F 1.797(wned to e)-.15 F -.15(xe)-.15 G 1.797(cute the).15 F .483(coprocess is a)108 156 R -.25(va)-.2 G .483(ilable as the v).25 F .483(alue of the v)-.25 F(ariable)-.25 E F1 -.27(NA)2.983 G(ME).27 E F02.983(_PID. The)B/F3 10/Times-Bold@0 SF(wait)2.983 E F0 -.2(bu)2.983 G.483(iltin command may be used to).2 F -.1(wa)108 168 S(it for the coprocess to terminate.).1 E(The return status of a coprocess is the e)108 184.8 Q(xit status of)-.15 E F1(command)2.5 E F0(.)A F3(Shell Function De\214nitions)87 201.6Q F0 2.697(As)108 213.6 S .198(hell function is an object that is called lik)-2.697 F 2.698(eas)-.1 G.198(imple command and e)-2.698 F -.15(xe)-.15 G .198(cutes a compound command with).15 F 2.5(an)108 225.6 S .5 -.25(ew s)-2.5 H(et of positional parameters.).25 E(Shell functions are declared as follo)5 E(ws:)-.25 E F1(name)108 242.4Q F0(\(\))2.5 E F1(compound\255command)2.5 E F0([)2.5 E F1 -.37(re)C(dir).37 E(ection)-.37 E F0(])A F3(function)108 254.4 Q F1(name)2.5 E F0([\(\)])2.5 E F1(compound\255command)2.5 E F0([)2.5 E F1 -.37(re)C(dir).37 E(ection)-.37 E F0(])A 1.403(This de\214nes a function named)144266.4 R F1(name)3.902 E F0 6.402(.T)C 1.402(he reserv)-6.402 F 1.402(ed w)-.15 F(ord)-.1 E F3(function)3.902 E F0 1.402(is optional.)3.902 F1.402(If the)6.402 F F3(function)3.902 E F0(reserv)144 278.4 Q .162(ed w)-.15 F .162(ord is supplied, the parentheses are optional.)-.1 F(The)5.162 E F1(body)2.662 E F0 .162(of the function is the compound)2.662 F(command)144 290.4 Q F1(compound\255command)2.784 E F0(\(see)3.354 E F3 .084(Compound Commands)2.584 F F0(abo)2.584 E -.15(ve)-.15 G2.584(\). That).15 F .084(command is usually a)2.584 F F1(list)144 302.4Q F0 .044(of commands between { and }, b)2.544 F .044(ut may be an)-.2 F2.544(yc)-.15 G .044(ommand listed under)-2.544 F F3 .044(Compound Commands)2.544 F F0(abo)144 314.4 Q -.15(ve)-.15 G(.).15 E F1(compound\255command)6.671 E F0 1.671(is e)4.171 F -.15(xe)-.15 G 1.671(cuted whene).15 F -.15(ve)-.25 G(r).15 E F1(name)4.171 E F0 1.671(is speci\214ed as the name of a simple)4.171 F 3.008(command. An)144326.4 R 3.009(yr)-.15 G .509(edirections \(see)-3.009 F F2(REDIRECTION)3.009 E F0(belo)2.759 E .509(w\) speci\214ed when a function is de\214ned are)-.25 F .581(performed when the function is e)144 338.4 R -.15(xe)-.15 G 3.081(cuted. The).15 F -.15(ex)3.081 G .58(it status of a function de\214nition is zero unless a).15 F .177(synta\x error occurs or a readonly function with the same name already e)144350.4 R 2.678(xists. When)-.15 F -.15(exe)2.678 G .178(cuted, the).15 F-.15(ex)144 362.4 S .64(it status of a function is the e).15 F .64(xit status of the last command e)-.15 F -.15(xe)-.15 G .64(cuted in the body).15 F 5.64(.\()-.65 G(See)-5.64 E F2(FUNC-)3.14 E(TIONS)144 374.4 Q F0(belo)2.25 E -.65(w.)-.25 G(\)).65 E/F4 10.95/Times-Bold@0 SF(COMMENTS)72 391.2 Q F0 .982(In a non-interacti)108403.2 R 1.282 -.15(ve s)-.25 H .982(hell, or an interacti).15 F 1.282-.15(ve s)-.25 H .982(hell in which the).15 F F3(interacti)3.482 E -.1(ve)-.1 G(_comments).1 E F0 .982(option to the)3.482 F F3(shopt)3.482 EF0 -.2(bu)108 415.2 S .952(iltin is enabled \(see).2 F F2 .952(SHELL B)3.452 F(UIL)-.09 E .952(TIN COMMANDS)-.828 F F0(belo)3.202 E .952(w\), a w)-.25 F .952(ord be)-.1 F .952(ginning with)-.15 F F3(#)3.451 EF0 .951(causes that w)3.451 F(ord)-.1 E .604(and all remaining characters on that line to be ignored.)108 427.2 R.605(An interacti)5.605 F .905 -.15(ve s)-.25 H .605(hell without the).15 F F3(interacti)3.105 E -.1(ve)-.1 G(_com-).1 E(ments)108 439.2 Q F01.337(option enabled does not allo)3.837 F 3.837(wc)-.25 G 3.836(omments. The)-3.837 F F3(interacti)3.836 E -.1(ve)-.1 G(_comments).1 EF0 1.336(option is on by def)3.836 F 1.336(ault in)-.1 F(interacti)108451.2 Q .3 -.15(ve s)-.25 H(hells.).15 E F4 -.11(QU)72 468 S -.438(OT).11 G(ING).438 E F1(Quoting)108 480 Q F0 .477(is used to remo)2.977 F.777 -.15(ve t)-.15 H .477(he special meaning of certain characters or w).15 F .477(ords to the shell.)-.1 F .478(Quoting can be)5.478 F .185(used to disable special treatment for special characters, to pre)108492 R -.15(ve)-.25 G .185(nt reserv).15 F .184(ed w)-.15 F .184(ords from being recognized as)-.1 F(such, and to pre)108 504 Q -.15(ve)-.25 G(nt parameter e).15 E(xpansion.)-.15 E .288(Each of the)108 520.8R F1(metac)2.788 E(har)-.15 E(acter)-.15 E(s)-.1 E F0 .288(listed abo)2.788 F .588 -.15(ve u)-.15 H(nder).15 E F2(DEFINITIONS)2.788 E F0 .288(has special meaning to the shell and must be)2.538 F(quoted if it is to represent itself.)108 532.8 Q 1.345(When the command history e)108 549.6 R 1.344(xpansion f)-.15 F 1.344(acilities are being used \(see)-.1 F F2(HIST)3.844 E(OR)-.162 E 3.594(YE)-.315 G(XP)-3.594 E(ANSION)-.666 E F0(belo)3.594 E 1.344(w\), the)-.25 F F1(history e)108 561.6 Q(xpansion)-.2 E F0(character)2.5 E 2.5(,u)-.4 G(sually)-2.5 E F3(!)2.5 E F0 2.5(,m)C(ust be quoted to pre)-2.5E -.15(ve)-.25 G(nt history e).15 E(xpansion.)-.15 E(There are three quoting mechanisms: the)108 578.4 Q F1(escape c)2.5 E(har)-.15 E(acter)-.15 E F0 2.5(,s).73 G(ingle quotes, and double quotes.)-2.5 E 2.974(An)108 595.2 S .474(on-quoted backslash \()-2.974 F F3(\\)A F0 2.974(\)i)C 2.974(st)-2.974G(he)-2.974 E F1 .474(escape c)2.974 F(har)-.15 E(acter)-.15 E F0 5.474(.I).73 G 2.974(tp)-5.474 G(reserv)-2.974 E .474(es the literal v)-.15 F.474(alue of the ne)-.25 F .475(xt character that)-.15 F(follo)108 607.2Q 1.554(ws, with the e)-.25 F 1.553(xception of <ne)-.15 F 4.053(wline>. If)-.25 F(a)4.053 E F3(\\)4.053 E F0(<ne)A 1.553(wline> pair appears, and the backslash is not itself)-.25 F 1.122(quoted, the)108 619.2 R F3(\\)3.622 E F0(<ne)A 1.122(wline> is treated as a line continuation \(that is, it is remo)-.25 F-.15(ve)-.15 G 3.622(df).15 G 1.123(rom the input stream and)-3.622 F(ef)108 631.2 Q(fecti)-.25 E -.15(ve)-.25 G(ly ignored\).).15 E .295(Enclosing characters in single quotes preserv)108 648 R .295(es the literal v)-.15 F .295(alue of each character within the quotes.)-.25 F 2.795(As)5.295 G(in-)-2.795 E(gle quote may not occur between single quotes, e)108 660 Q -.15(ve)-.25G 2.5(nw).15 G(hen preceded by a backslash.)-2.5 E .033(Enclosing characters in double quotes preserv)108 676.8 R .034(es the literal v)-.15 F .034(alue of all characters within the quotes, with the)-.25 F -.15(ex)108688.8 S .828(ception of).15 F F3($)3.328 E F0(,)A F3<92>3.328 E F0(,)AF3(\\)3.328 E F0 3.328(,a)C .828(nd, when history e)-3.328 F .828(xpansion is enabled,)-.15 F F3(!)3.328 E F0 5.828(.T)C .828(he characters)-5.828 F F3($)3.328 E F0(and)3.328 E F3<92>3.328 E F0.827(retain their special)3.328 F .074(meaning within double quotes.)108700.8 R .074(The backslash retains its special meaning only when follo)5.074 F .075(wed by one of the)-.25 F(follo)108 712.8 Q .205(wing characters:)-.25 F F3($)2.705 E F0(,)A F3<92>2.705 E F0(,)A F3(")3.538 E F0(,).833 E F3(\\)2.705 E F0 2.705(,o)C(r)-2.705 E F3(<newline>)2.705 E F0 5.205(.A)C .204(double quote may be quoted within double quotes by pre-)-2.5 F .081(ceding it with a backslash.)108 724.8 R .082(If enabled, history e)5.082 F .082(xpansion will be performed unless an)-.15 F F3(!)2.582 E F0.082(appearing in double)5.082 F(GNU Bash-4.2)72 768 Q(2010 December 28)135.965 E(7)190.955 E 0 Cg EP%%Page: 8 8%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\))-.35 E(quotes is escaped using a backslash.)108 84 Q(The backslash preceding the)5 E/F1 10/Times-Bold@0 SF(!)2.5 E F0(is not remo)5 E -.15(ve)-.15 G(d.).15 E(The special parameters)108100.8 Q F1(*)2.5 E F0(and)2.5 E F1(@)2.5 E F0(ha)2.5 E .3 -.15(ve s)-.2H(pecial meaning when in double quotes \(see).15 E/F2 9/Times-Bold@0 SF-.666(PA)2.5 G(RAMETERS).666 E F0(belo)2.25 E(w\).)-.25 E -.8(Wo)108117.6 S .212(rds of the form).8 F F1($)2.712 E F0<08>A/F3 10/Times-Italic@0 SF(string)A F0 2.712<0861>C .211(re treated specially)-2.712 F 5.211(.T)-.65 G .211(he w)-5.211 F .211(ord e)-.1 F .211(xpands to)-.15 F F3(string)2.711 E F0 2.711(,w)C .211(ith backslash-escaped char)-2.711 F(-)-.2 E .604(acters replaced as speci\214ed by the ANSI C standard.)108 129.6 R .605(Backslash escape sequences, if present, are decoded)5.605 F(as follo)108 141.6 Q(ws:)-.25 E F1(\\a)144 153.6 Q F0(alert \(bell\))28.22 E F1(\\b)144 165.6 Q F0(backspace)27.66 E F1(\\e)144 177.6 Q(\\E)144 189.6 QF0(an escape character)26.55 E F1(\\f)144 201.6 Q F0(form feed)29.89 EF1(\\n)144 213.6 Q F0(ne)27.66 E 2.5(wl)-.25 G(ine)-2.5 E F1(\\r)144225.6 Q F0(carriage return)28.78 E F1(\\t)144 237.6 Q F0(horizontal tab)29.89 E F1(\\v)144 249.6 Q F0 -.15(ve)28.22 G(rtical tab).15 E F1(\\\\)144 261.6 Q F0(backslash)30.44 E F1<5c08>144 273.6 Q F0(single quote)30.44 E F1(\\")144 285.6 Q F0(double quote)27.67 E F1(\\)144 297.6 Q F3(nnn)A F0(the eight-bit character whose v)18.22 E(alue is the octal v)-.25 E(alue)-.25 E F3(nnn)2.5 E F0(\(one to three digits\))2.5 E F1(\\x)144 309.6 Q F3(HH)A F0(the eight-bit character whose v)13.78 E(alue is the he)-.25 E(xadecimal v)-.15 E(alue)-.25 E F3(HH)2.5 E F0(\(one or tw)2.5 E 2.5(oh)-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E F1(\\u)144 321.6 Q F3(HHHH)A F0 1.507(the Unicode \(ISO/IEC 10646\) character whose v)180 333.6 R 1.506(alue is the he)-.25 F 1.506(xadecimal v)-.15 F(alue)-.25 E F3(HHHH)4.006 E F0(\(one to four he)180 345.6 Q 2.5(xd)-.15 G(igits\))-2.5 E F1(\\U)144 357.6 Q F3(HHHHHHHH)A F0 .547(the Unicode \(ISO/IEC 10646\) character whose v)180 369.6 R .547(alue is the he)-.25 F .548(xadecimal v)-.15 F(alue)-.25 E F3(HHHHH-)3.048 E(HHH)180 381.6 Q F0(\(one to eight he)2.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -