?? history_3.ps
字號:
(may be omitted if)3.557 F F3(string)3.557 E F0(is)3.557 E(follo)144506.4 Q(wed immediately by a ne)-.25 E(wline.)-.25 E/F4 12/Times-Bold@0SF(^)108 523.4 Q F3(string1)-5 I F4(^)5 I F3(string2)-5 I F4(^)5 I F02.66(Quick substitution.)144 530.4 R 2.66(Repeat the last command, replacing)7.66 F F3(string1)5.16 E F0(with)5.16 E F3(string2)5.16 E F0 7.66(.E).02 G(qui)-7.66 E -.25(va)-.25 G2.66(lent to).25 F -.74(``)144 542.4 S(!!:s/).74 E F3(string1)A F0(/)AF3(string2)A F0(/')A 2.5('\()-.74 G(see)-2.5 E F2(Modi\214ers)2.5 E F0(belo)2.5 E(w\).)-.25 E F2(!#)108 554.4 Q F0(The entire command line typed so f)27.67 E(ar)-.1 E(.)-.55 E F2 -.75(Wo)87 571.2 S(rd Designators).75 E F0 -.8(Wo)108 583.2 S 1.313(rd designators are used to select desired w).8 F 1.314(ords from the e)-.1 F -.15(ve)-.25 G 3.814(nt. A).15 F F2(:)3.814 E F0 1.314(separates the e)3.814 F -.15(ve)-.25 G 1.314(nt speci\214cation).15 F.53(from the w)108 595.2 R .529(ord designator)-.1 F 5.529(.I)-.55 G3.029(tm)-5.529 G .529(ay be omitted if the w)-3.029 F .529(ord designator be)-.1 F .529(gins with a)-.15 F F2(^)3.029 E F0(,)A F2($)3.029 E F0(,)A F2(*)3.029 E F0(,)A F2<ad>3.029 E F0 3.029(,o)C(r)-3.029 E F2(%)3.029 E F0 5.529(.W)C(ords)-6.329 E 1.3(are numbered from the be)108 607.2 R 1.3(ginning of the line, with the \214rst w)-.15 F 1.301(ord being denoted by 0 \(zero\).)-.1 F -.8(Wo)6.301 G 1.301(rds are).8F(inserted into the current line separated by single spaces.)108 619.2 QF2 2.5(0\()108 636 S(zer)-2.5 E(o\))-.18 E F0(The zeroth w)144 648 Q 2.5(ord. F)-.1 F(or the shell, this is the command w)-.15 E(ord.)-.1 E F3(n)108 660 Q F0(The)31 E F3(n)2.5 E F0(th w)A(ord.)-.1 E F2(^)108 672 QF0(The \214rst ar)32.67 E 2.5(gument. That)-.18 F(is, w)2.5 E(ord 1.)-.1E F2($)108 684 Q F0(The last ar)31 E(gument.)-.18 E F2(%)108 696 Q F0(The w)26 E(ord matched by the most recent `?)-.1 E F3(string)A F0(?' search.)A F3(x)108 708 Q F2<ad>A F3(y)A F0 2.5(Ar)21.42 G(ange of w)-2.5 E(ords; `\255)-.1 E F3(y)A F0 2.5('a)C(bbre)-2.5 E(viates `0\255)-.25 E F3(y)A F0('.)A(GNU History 4.3)72 768 Q(2002 January 31)131.79 E(1)195.95 E EP%%Page: 2 2%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F(OR)-.18 E(Y\(3\))-.65 E/F1 10/Times-Bold@0 SF(*)108 84 Q F0 .316(All of the w)31 F .316(ords b)-.1 F .316(ut the zeroth.)-.2 F .315(This is a synon)5.315 F .315(ym for `)-.15 F/F2 10/Times-Italic@0 SF(1\255$)A F0 2.815('. It)B .315(is not an error to use)2.815 F F1(*)2.815 E F0 .315(if there is)2.815 F(just one w)144 96 Q(ord in the e)-.1E -.15(ve)-.25 G(nt; the empty string is returned in that case.).15 E F1(x*)108 108 Q F0(Abbre)26 E(viates)-.25 E F2(x\255$)2.5 E F0(.)A F1<78ad>108 120 Q F0(Abbre)25.3 E(viates)-.25 E F2(x\255$)2.5 E F0(lik)2.5E(e)-.1 E F1(x*)2.5 E F0 2.5(,b)C(ut omits the last w)-2.7 E(ord.)-.1 E(If a w)108 136.8 Q(ord designator is supplied without an e)-.1 E -.15(ve)-.25 G(nt speci\214cation, the pre).15 E(vious command is used as the e)-.25 E -.15(ve)-.25 G(nt.).15 E F1(Modi\214ers)87 153.6 Q F0 .183(After the optional w)108 165.6 R .183(ord designator)-.1 F 2.683(,t)-.4 G .184(here may appear a sequence of one or more of the follo)-2.683 F .184(wing modi\214ers,)-.25 F(each preceded by a `:'.)108 177.6 Q F1(h)108194.4 Q F0(Remo)30.44 E .3 -.15(ve a t)-.15 H(railing \214le name component, lea).15 E(ving only the head.)-.2 E F1(t)108 206.4 Q F0(Remo)32.67 E .3 -.15(ve a)-.15 H(ll leading \214le name components, lea).15 E(ving the tail.)-.2 E F1(r)108 218.4 Q F0(Remo)31.56 E .3 -.15(ve a t)-.15 H(railing suf).15 E(\214x of the form)-.25 E F2(.xxx)2.5 E F0 2.5(,l)C(ea)-2.5 E(ving the basename.)-.2 E F1(e)108 230.4 Q F0(Remo)31.56 E .3 -.15(ve a)-.15 H(ll b).15 E(ut the trailing suf)-.2 E(\214x.)-.25 E F1(p)108 242.4Q F0(Print the ne)30.44 E 2.5(wc)-.25 G(ommand b)-2.5 E(ut do not e)-.2E -.15(xe)-.15 G(cute it.).15 E F1(q)108 254.4 Q F0(Quote the substituted w)30.44 E(ords, escaping further substitutions.)-.1 E F1(x)108 266.4 Q F0(Quote the substituted w)31 E(ords as with)-.1E F1(q)2.5 E F0 2.5(,b)C(ut break into w)-2.7 E(ords at)-.1 E F1(blanks)2.5 E F0(and ne)2.5 E(wlines.)-.25 E F1(s/)108 278.4 Q F2(old)A F1(/)AF2(ne)A(w)-.15 E F1(/)A F0(Substitute)144 290.4 Q F2(ne)2.814 E(w)-.15 EF0 .314(for the \214rst occurrence of)2.814 F F2(old)2.814 E F0 .314(in the e)2.814 F -.15(ve)-.25 G .314(nt line.).15 F(An)5.314 E 2.814(yd)-.15 G .314(elimiter can be used in place)-2.814 F .616(of /.)144302.4 R .617(The \214nal delimiter is optional if it is the last character of the e)5.616 F -.15(ve)-.25 G .617(nt line.).15 F .617(The delimiter may)5.617F .75(be quoted in)144 314.4 R F2(old)3.25 E F0(and)3.25 E F2(ne)3.25 E(w)-.15 E F0 .75(with a single backslash.)3.25 F .749(If & appears in)5.75 F F2(ne)3.249 E(w)-.15 E F0 3.249(,i).31 G 3.249(ti)-3.249 G 3.249(sr)-3.249 G .749(eplaced by)-3.249 F F2(old)3.249 E F0 5.749(.A).77 G.369(single backslash will quote the &.)144 326.4 R(If)5.369 E F2(old)2.869 E F0 .37(is null, it is set to the last)2.869 F F2(old)2.87 E F0.37(substituted, or)2.87 F 2.87(,i)-.4 G 2.87(fn)-2.87 G 2.87(op)-2.87 G(re)-2.87 E(vi-)-.25 E(ous history substitutions took place, the last)144 338.4 Q F2(string)2.5 E F0(in a)2.5 E F1(!?)2.5 E F2(string)A F1([?])A F0(search.)5 E F1(&)108 350.4 Q F0(Repeat the pre)27.67 E(vious substitution.)-.25 E F1(g)108 362.4 Q F0 .398(Cause changes to be applied o)31 F -.15(ve)-.15 G 2.898(rt).15 G .398(he entire e)-2.898 F -.15(ve)-.25 G .398(nt line.).15 F .397(This is used in conjunction with `)5.398 F F1(:s)A F0 2.897('\()C(e.g.,)-2.897 E(`)144 374.4 Q F1(:gs/)A F2(old)A F1(/)A F2(ne)A(w)-.15 EF1(/)A F0 1.218('\) or `)B F1(:&)A F0 3.718('. If)B 1.218(used with `)3.718 F F1(:s)A F0 1.218(', an)B 3.718(yd)-.15 G 1.219(elimiter can be used in place of /, and the \214nal)-3.718 F(delimiter is optional if it is the last character of the e)144 386.4 Q-.15(ve)-.25 G(nt line.).15 E/F3 10.95/Times-Bold@0 SF(PR)72 403.2 Q(OGRAMMING WITH HIST)-.329 E(OR)-.197 E 2.738(YF)-.383 G(UNCTIONS)-2.738E F0(This section describes ho)108 415.2 Q 2.5(wt)-.25 G 2.5(ou)-2.5 G(se the History library in other programs.)-2.5 E F1(Intr)87 432 Q(oduction to History)-.18 E F0 .797(The programmer using the History library has a)108 444 R -.25(va)-.2 G.796(ilable functions for remembering lines on a history list,).25 F.307(associating arbitrary data with a line, remo)108 456 R .308(ving lines from the list, searching through the list for a line con-)-.15 F .303(taining an arbitrary te)108 468 R .303(xt string, and referencing an)-.15 F 2.803(yl)-.15 G .303(ine in the list directly)-2.803 F 5.303(.I)-.65 G 2.803(na)-5.303 G.303(ddition, a history)-2.803 F F2 -.2(ex)2.802 G(pansion).2 E F0(function is a)108 480 Q -.25(va)-.2 G(ilable which pro).25 E(vides for a consistent user interf)-.15 E(ace across dif)-.1 E(ferent programs.)-.25 E .059(The user using programs written with the \History library has the bene\214t of a consistent user interf)108 496.8R .059(ace with a)-.1 F .918(set of well-kno)108 508.8 R .917(wn commands for manipulating the te)-.25 F .917(xt of pre)-.15 F .917(vious lines and using that te)-.25 F .917(xt in ne)-.15 F 3.417(wc)-.25G(om-)-3.417 E 4.183(mands. The)108 520.8 R 1.684(basic history manipul\ation commands are identical to the history substitution pro)4.183 F1.684(vided by)-.15 F F1(bash)108 532.8 Q F0(.)A .904(If the programmer desires, he can use the Readline library)108 549.6 R3.403(,w)-.65 G .903(hich includes some history manipulation by)-3.403 F(def)108 561.6 Q(ault, and has the added adv)-.1 E(antage of command line editing.)-.25 E .39(Before declaring an)108578.4 R 2.89(yf)-.15 G .39(unctions using an)-2.89 F 2.89(yf)-.15 G .39(unctionality the History library pro)-2.89 F .39(vides in other code, an appli-)-.15 F .067(cation writer should include the \214le)108 590.4 R F2(<r)4.233 E(eadline/history)-.37 E(.h>)-.55 E F0 .067(in an)4.233 F 2.566<798c>-.15G .066(le that uses the History library')-2.566 F 2.566(sf)-.55 G(eatures.)-2.566 E .538(It supplies e)108 602.4 R .538(xtern declarations for all of the library')-.15 F 3.038(sp)-.55 G .538(ublic functions and v)-3.038 F .539(ariables, and declares all of the)-.25 F(public data structures.)108 614.4 Q F1(History Storage)87 643.2 QF0(The history list is an array of history entries.)108 655.2 Q 2.5(Ah)5G(istory entry is declared as follo)-2.5 E(ws:)-.25 E F2(typedef void *)108 672 Q F1(histdata_t;)2.5 E F0(typedef struct _hist_entry {)108 688.8Q(char *line;)113 700.8 Q(histdata_t data;)113 712.8 Q 2.5(}H)108 724.8S(IST_ENTR)-2.5 E -.92(Y;)-.65 G(GNU History 4.3)72 768 Q(2002 January 31)131.79 E(2)195.95 E EP%%Page: 3 3%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F(OR)-.18 E(Y\(3\))-.65 E(The history list itself might therefore be declared as)108 84 Q/F1 10/Times-Italic@0 SF(HIST_ENTR)108 100.8 Q 2.5(Y*)-.18 G(*)-2.5 E/F2 10/Times-Bold@0 SF(the_history_list;)2.5 E F0(The state of the History li\brary is encapsulated into a single structure:)108 117.6 Q(/*)108 134.4Q 2.5(*As)110.5 146.4 S(tructure used to pass around the current state of the history)-2.5 E(.)-.65 E(*/)110.5 158.4 Q(typedef struct _hist_state {)108 170.4 Q(HIST_ENTR)113 182.4 Q 2.5(Y*)-.65 G(*entries; /* Pointer to the entries themselv)-2.5 E(es. */)-.15 E(int of)113 194.4 Q 25(fset; /*)-.25 F(The location pointer within this array)2.5 E 2.5(.*)-.65 G(/)-2.5 E(int length;)113 206.4 Q(/* Number of elements within this array)27.5 E2.5(.*)-.65 G(/)-2.5 E(int size;)113 218.4 Q(/* Number of slots allocated to this array)32.5 E 2.5(.*)-.65 G(/)-2.5E(int \215ags;)113 230.4 Q 2.5(}H)108 242.4 S(IST)-2.5 E(OR)-.18 E(Y_ST)-.65 E -1.11(AT)-.93 G(E;)1.11 E(If the \215ags member includes)108259.2 Q F2(HS_STIFLED)2.5 E F0 2.5(,t)C(he history has been sti\215ed.)-2.5 E/F3 10.95/Times-Bold@0 SF(History Functions)72 276 Q F0(This section describes the calling sequence for the v)108 288 Q(arious functions e)-.25 E(xported by the GNU History library)-.15 E(.)-.65 E F2(Initializing History and State Management)87 304.8 Q F0 1.274(This section describes functions used to initialize and manage the sta\te of the History library when you)108 316.8 R -.1(wa)108 328.8 S(nt to use the history functions in your program.).1 E F1(void)108 352.8Q F2(using_history)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E(Be)108364.8 Q(gin a session in which the history functions might be used.)-.15E(This initializes the interacti)5 E .3 -.15(ve v)-.25 H(ariables.)-.1 EF1(HIST)108 388.8 Q(OR)-.18 E(Y_ST)-.18 E -.37(AT)-.5 G 2.5(E*).37 G F2(history_get_history_state)A F0(\()4.166 E F1(void)A F0(\))1.666 E(Return a structure describing the current state of the input history)108 400.8 Q(.)-.65 E F1(void)108 424.8 Q F2(history_set_history_state)2.5 E F0(\()4.166 E F1(HIST)A(OR)-.18 E(Y_ST)-.18 E -.37(AT)-.5 G 2.5(E*).37 G(state)-2.5 E F0(\))1.666 E(Set the state of the history list according to)108 436.8 Q F1(state)2.5E F0(.)A F2(History List Management)87 465.6 Q F0(These functions manage indi)108 477.6 Q(vidual entries on the history \list, or set parameters managing the list itself.)-.25 E F1(void)108501.6 Q F2(add_history)2.5 E F0(\()4.166 E F1(const c)A(har *string)-.15E F0(\))1.666 E(Place)108 513.6 Q F1(string)2.5 E F0(at the end of the history list.)2.5 E(The associated data \214eld \(if an)5 E(y\) is set to)-.15 E F2(NULL)2.5 E F0(.)A F1(HIST_ENTR)108 537.6 Q 2.5(Y*)-.18 G F2 -.18(re)C(mo).18E -.1(ve)-.1 G(_history).1 E F0(\()4.166 E F1(int whic)A(h)-.15 E F0(\))1.666 E(Remo)108 549.6 Q .352 -.15(ve h)-.15 H .052(istory entry at of).15 F(fset)-.25 E F1(whic)2.553 E(h)-.15 E F0 .053(from the history)2.553 F 5.053(.T)-.65 G .053(he remo)-5.053 F -.15(ve)-.15 G 2.553(de).15 G .053(lement is returned so you can free the)-2.553 F(line, data, and containing structure.)108 561.6 Q F1(HIST_ENTR)108585.6 Q 2.5(Y*)-.18 G F2 -.18(re)C(place_history_entry).18 E F0(\()4.166E F1(int whic)A -.834(h, const)-.15 F -.15(ch)2.5 G(ar *line).15 E 1.666(,h)-.1 G(istdata_t data)-1.666 E F0(\))3.332 E(Mak)108 597.6 Q 2.868(et)-.1 G .368(he history entry at of)-2.868 F(fset)-.25 E F1(whic)2.868E(h)-.15 E F0(ha)2.868 E -.15(ve)-.2 G F1(line)3.018 E F0(and)2.868 E F1(data)2.868 E F0 5.367(.T)C .367(his returns the old entry so you can dispose of)-5.367 F(the data.)108609.6 Q(In the case of an in)5 E -.25(va)-.4 G(lid).25 E F1(whic)2.5 E(h)-.15 E F0 2.5(,a)C F2(NULL)A F0(pointer is returned.)2.5 E F1(void)108 633.6 Q F2(clear_history)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E(Clear the history list by deleting all the entries.)108 645.6 Q F1(void)108 669.6 Q F2(sti\215e_history)2.5 E F0(\()4.166 E F1(int max)AF0(\))1.666 E(Sti\215e the history list, remembering only the last)108681.6 Q F1(max)2.5 E F0(entries.)2.5 E F1(int)108 705.6 Q F2(unsti\215e_history)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E .46(Stop sti\215ing the history)108 717.6 R 5.46(.T)-.65 G .46(his returns the pre)-5.46 F .46(viously-set maximum number of history entries \(as set by)-.25 F F2(sti-)2.96 E(\215e_history\(\))108 729.6 Q F0 2.5(\). history)B -.1(wa)2.5 G 2.5(ss).1 G 2.5(ti\215ed. The)-2.5 F -.25(va)2.5 G(lue is positi).25 E .3 -.15(ve i)-.25 H 2.5(ft).15 G(he history w)-2.5 E(as sti\215ed, ne)-.1 E -.05(ga)-.15 G(ti).05 E .3 -.15(ve i)-.25 H 2.5(fi).15 G 2.5(tw)-2.5 G(asn')-2.6 E(t.)-.18 E(GNU History 4.3)72 768 Q(2002 January 31)131.79 E(3)195.95 E EP%%Page: 4 4%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF(HIST)72 48 Q(OR)-.18 E 357.18(Y\(3\) HIST)-.65 F(OR)-.18 E(Y\(3\))-.65 E/F1 10/Times-Italic@0 SF(int)108 84 Q/F2 10/Times-Bold@0 SF(history_is_sti\215ed)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E(Returns non-zero if the history is sti\215ed, zero if it is not.)108 96Q F2(Inf)87 124.8 Q(ormation About the History List)-.25 E F0(These fun\ctions return information about the entire history list or indi)108136.8 Q(vidual list entries.)-.25 E F1(HIST_ENTR)108 160.8 Q 2.5(Y*)-.18G(*)-2.5 E F2(history_list)2.5 E F0(\()4.166 E F1(void)A F0(\))1.666 E.708(Return a)108 172.8 R F2(NULL)3.208 E F0 .708(terminated array of)3.208 F F1(HIST_ENTR)3.208 E 3.208(Y*)-.18 G F0 .708(which is the current input history)B 5.707(.E)-.65 G .707(lement 0 of this)-5.707 F(list is the be)108 184.8 Q(ginning of time.)-.15 E(If there is no history)5 E 2.5(,r)-.65 G(eturn)-2.5 E F2(NULL)2.5E F0(.)A F1(int)108 208.8 Q F2(wher)2.5 E(e_history)-.18 E F0(\()4.166 EF1(void)A F0(\))1.666 E(Returns the of)108 220.8 Q(fset of the current history element.)-.25 E F1(HIST_ENTR)108 244.8 Q2.5(Y*)-.18 G F2(curr)A(ent_history)-.18 E F0(\()4.166 E F1(void)A F0(\))1.666 E 1.373(Return the history entry at the current position, as determined by)108256.8 R F2(wher)3.873 E(e_history\(\))-.18 E F0 6.373(.I)C 3.873(ft)-6.373 G 1.374(here is no entry)-3.873 F(there, return a)108 268.8 Q F2(NULL)2.5 E F0(pointer)2.5 E(.)-.55 E F1(HIST_ENTR)108 292.8 Q 2.5(Y*)-.18 G F2(history_get)A F0(\()4.166 E F1(int of)A(fset)-.18 E F0(\))1.666 E .288(Return the history entry at position)108 304.8 R F1(of)2.787 E(fset)-.18 E F0 2.787(,s)C .287(tarting from)-2.787 F F2(history_base)2.787 E F0 5.287(.I)C 2.787(ft)-5.287 G .287(here is no entry there, or if)-2.787 F F1(of)2.787 E(fset)-.18 E F0(is greater than the history length, return a)108 316.8 Q F2(NULL)2.5 EF0(pointer)2.5 E(.)-.55 E F1(int)108 340.8 Q F2(history_total_bytes)2.5E F0(\()4.166 E F1(void)A F0(\))1.666 E .391(Return the number of bytes that the primary history entries are using.)108 352.8 R .392(This function returns the sum of the)5.392 F(lengths of all the lines in the history)108 364.8 Q(.)-.65 E F2(Mo)87393.6 Q(ving Ar)-.1 E(ound the History List)-.18 E F0(These functions allo)108 405.6 Q 2.5(wt)-.25 G(he current inde)-2.5 E2.5(xi)-.15 G(nto the history list to be set or changed.)-2.5 E F1(int)108 429.6 Q F2(history_set_pos)2.5 E F0(\()4.166 E F1(int pos)A F0(\))1.666 E .79(Set the current history of)108 441.6 R .79(fset to)-.25 F F1(pos)3.29 E F0 3.29(,a)C 3.29(na)-3.29 G .79(bsolute inde)-3.29 F 3.29(xi)-.15 G .79(nto the list.)-3.29 F .79(Returns 1 on success, 0 if)5.79F F1(pos)3.29 E F0 .79(is less)3.29 F(than zero or greater than the number of history entries.)108 453.6 Q F1(HIST_ENTR)108 477.6 Q 2.5(Y*)-.18 G F2(pr)A -.15(ev)-.18 G(ious_history).15 E F0(\()4.166 E F1(void)A F0(\))1.666 E .207(Back up the current history of)108 489.6 R .207(fset to the pre)-.25 F.207(vious history entry)-.25 F 2.708(,a)-.65 G .208(nd return a pointer to that entry)-2.708 F 5.208(.I)-.65 G 2.708(ft)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -