ule - Unix Line Editor
                                 VER 2.1
                              mark holgerson

(Document is not hypertexted, but is in alphabetacal order. Do a save as to
your local machine, and bookmark it there for quick reference)

     ule is a line editor originally written in TURBO C (generic C). It  is
intended  as  a  utility  editor  for  UNIX/PC  environment  that  provides
simplicity and ease of use for the  UNIX/PC  novice  or  experienced  user.
While  there are much more powerful UNIX/PC editors like VI and EMACS/QEDIT
their use requires a dedicated effort to master and retain the skills to be
used effectively.  The simple editor(s) ED/EDLIN are simply  pathetic.  ule
is intended as a happy medium that operates intuitively and provides useful
capabilities  at the same time.  ule is patterned after the UNISYS 1100 @ED
editor (as well as many others).

     ule  requires about 5 minutes to learn. The file ulen5min.htm contains
the 5 minute course to ule. After reading,  the  user  should  be  able  to
insert,  delete, replace, and change lines of a file, locate text, and save
and  create  new  files.  This document  contains  the  complete  list  and
specifications  of the commands. It is recomended the user view the "ule in
5 minutes" document before viewing this one, but suit yourself.

     ule operates by loading a file into a work  area  and  accessing  that
work  area  as  though  it  were  an  array  of lines (actually an array of
pointers to lines).  Lines are referenced by their line number.  Lines  may
be  inserted,  replaced,  deleted,  changed, moved, copied, hacked, broken,
joined,...  etc. Lines may also be inserted by toggling to an INSERT  mode.
Files may be loaded, added, saved, and written. Data in the edited file may
be  located  (any where in a line) and found (exact position in a line).  A
LEADING tab  facility  is  provided  (ONLY  leading  tabs  are  recognized,
imbedded tabs are NOT).

     In  operation, ule  presents  the user with a prompt consisting of the
present line number.  Commands consist of a single letter (upper  or  lower
case),  or  number, or +,-,!,? followed by the command syntax.

        26.>abcdefghijkmlnopqrsetuvxyz
      26E>x command text

     o Anything in red  is what the user enters:
     o Anything in blue is to draw the readers attention:

     If a <CR> (carriage-return) is entered  by itself the editor goes into
INSERT mode and all subsequent entries are inserted until a <CR> is entered
by itself returning ule to EDIT mode.

        26.>abcdefghijkmlnopqrsetuvxyz
      26E><CR>
        26I>123
        27I>456789
        28I><CR>
      28E>

     The  commands  (b)break,  (c)hange,  (h)ack, (f)ind, and (l)ocate have
"memory"  and  may  be  entered  without  command  text  and  the  previous
respective entry will be repeated. The above commands followed by "a" means
all; apply this command from this line thru the end of file.


COMMANDS BY FUNCTION:
FILE: PRINT: SEARCH: o-old p-print l-locate s-save f-find w-write LINE: a-add MODIFY: q-quit i-insert d-delete c-change NAVIGATE: r-replace h-hack b-break x-space n-next j-join e-end MISC: #-line BLOCK: +-jump t-tab --jump m-move v-values k-kopy !-scale ?-help
COMMANDS BY ALPHABETICAL ORDER:
For the following commands: [ ] - indicates optional | - indicates or # - indicates number. STRING - a string of characters. QSTRING - a STRING that MAY be delimited by ' or " B - a blank.
>>> ? - HELP 0E>? >>>>>>>> ule VER :V2.0 (04/03/99) >>>>>>>> Copyright (c) 1998 - mark holgerson >>>>>>>> FILE :ule.c >>>>>>>> # Lines : 1369 >>>>>>>> Tabs : >>>> Last Break : >>>> Last Change : >>>> Last Hack : >>>> Last Locate : >>>> Last Find : >>>> a-add file j-lines s-save (file) >>>> b-break line k-kopy line(s) t-tab set >>>> c-change line(s) l-locate string u- >>>> d-delete line(s) m-move line(s) v-values >>>> e-end of file n-next line(s) w-write file >>>> f-find string o-old file x-spaces >>>> g- p-print line(s) y- >>>> h-hack string q-quit z-zap lines >>>> i-insert line r-replace line !-scale >>>> #-go to line # --back line(s) +-ahead line(s) >>>> <CR>-toggle insert mode 0E> - just a memory jogger
>>> a - ADD a FILENAME [#1 #2] Add the lines from file FILENAME (from the range #1 through #2 if given) after the present position in the edited file. EG: a init.c - add lines from init.c a 1.c 10 20 - add lines 10 thru 20 from 1.c 66.> if (command=='a') acommand(); 66E>a hiworld.c 67.>main() 68.> { 69.> printf("hi world!\n"); 70.> } >>> FILE <hiworld.c> 4 Lines Added 70E>
>>> b - BREAK b QSTRING Break the present line after QSTRING and place the balance of the line on the next line aligned with the present line. EG: b - repeat last break. b? - display last break. b ; - break after the first ; b (x=y) - break after (x=y) b ' " ' - break after B"B 33.>abcdefghijklmnopqrstuvwxyz 33E>b m 33.>abcdefghijklm 34.>nopqrstuvwxyz 34E>
>>> c - CHANGE c[a | ,# | ?] [ [/STRING1/STRING2/[g]] | [>STRING] ] Change occurrences of STRING1 to STRING2 for the given line, or all (a), or # lines; (g) indicates globally (all occurrences), where / is the delimiter (any non blank character), >STRING means append STRING to the given line. EG: c - repeat last change. c? - display last change. c /a/b/ - change the first a to b in a line ca /a/b/ - change the first a to b to end of file c /a/b/g - change all a's to b's in a line ca /a/b/g - change all a's to b to end of file c,10 /copy/type/ - change for the next 10 lines c .01/01/86.12/31/85. - change date c > /* comment */ - append to line ca >; - append ; to all lines 33.>abcdefghijklmnopqrstuvwxyz 33E>c /e/a/ 33.>abcdafghijklmnopqrstuvwxyz 33E>c /a/A/g 33.>AbcdAfghijklmnopqrstuvwxyz 33E>c > ABC 33.>AbcdAfghijklmnopqrstuvwxyz ABC 33E>
>>> d - DELETE d [#1 [#2]] Delete the present line, or #1 lines beginning at the present line, or lines #1 through #2. (BE CAREFUL!!!) EG: d - delete present line d 10 - delete the next 10 lines (!! NOT LINE #10 !!) d 11 20 - delete lines 10 thru 20 66E>p 66 76 66.> if (command=='a') acommand(); 67.> else if (command=='b') bcommand(); 68.> else if (command=='c') ccommand(); 69.> else if (command=='d') dcommand(); 70.> else if (command=='e') ecommand(); 71.> else if (command=='f') fcommand(); 72.> else if (command=='g') gcommand(); 73.> else if (command=='h') hcommand(); 74.> else if (command=='i') icommand(); 75.> else if (command=='j') jcommand(); 76.> else if (command=='k') kcommand(); 76E>70 70.> else if (command=='e') ecommand(); 70E>d 69.> else if (command=='d') dcommand(); 69E>67 67.> else if (command=='b') bcommand(); 67E>d 3 66.> if (command=='a') acommand(); 66E>p 10 66.> if (command=='a') acommand(); 67.> else if (command=='f') fcommand(); 68.> else if (command=='g') gcommand(); 69.> else if (command=='h') hcommand(); 70.> else if (command=='i') icommand(); 71.> else if (command=='j') jcommand(); 72.> else if (command=='k') kcommand(); 73.> else if (command=='l') lcommand(); 74.> else if (command=='m') mcommand(); 75.> else if (command=='n') ncommand(); 75E>d 69 71 68.> else if (command=='g') gcommand(); 68E>p 66 75 66.> if (command=='a') acommand(); 67.> else if (command=='f') fcommand(); 68.> else if (command=='g') gcommand(); 69.> else if (command=='k') kcommand(); 70.> else if (command=='l') lcommand(); 71.> else if (command=='m') mcommand(); 72.> else if (command=='n') ncommand(); 73.> else if (command=='o') ocommand(); 74.> else if (command=='p') pcommand(); 75.> else if (command=='q') qcommand(); 75E>
>>> e - END OF FILE Go to end of file. EG: 33.>abcdefghijkmlnopqrsetuvxyz 33E>e 1362.> } 1362E>
>>> f - FIND f[ ,# | *# | a | ? ]BSTRING Find the next occurrence of STRING, or all occurrences in ,# lines, or the next *# occurrences, or all(a) occurrences. Find requires a blank following the command info. Find looks for STRING in the exact position it is specified in. EG: f - repeat last find. f? - display last find. f copy - find first occurance of copy f { - find first occurance of BBB{ f,100 - repeat last find for 100 lines fa IF - find all occurances of IF f*20 procedure - find next 20 occurances of procedure 0.> 0E>f int 15.>int tabn,tabs[10]; /* # of tabs, tab stops */ 15E>f,20 16.>int nlines,nhits; /* lines 2 search,find, used by locate,find,etc */ 31.>int endsw; /* end user switch */ 32.>int fmodsw; /* file modified switch */ 33.>int n; /* current line pointer */ 34.>int e; /* end of file pointer */ 35E>f*3 37.>int argc; 96.>int processcommandline() 141.>int getcommand() 141E>
>>> g - Unused.
>>> h - HACK h[ ,# | a ] [[/]QSTRING[/]] Hack means delete the portion of the line following STRING for the present line, or ,# lines, or all (a) lines, where / is the delimiter (required if STRING contains leading or trailing spaces). EG: h - repeat last hack. h? - display last hack. h .ZIP - delete everything after .ZIP h,20 ; - delete everything after ; for 20 lines ha */ - delete everything after */ to end of file h " end;" - delete everything after Bend; 33.>abcdefghijklmnopqrstuvwxyz 33E>h m 33.>abcdefghijklm 33E>
>>> i - INSERT iBLINE Insert LINE into the edited file after the present line. Note that the INSERT command requires a blank in column 2. The i may be followed by a b which means "insert before" EG: i if (x=y) goto equals i if (a ne b) stop. ib # the following line is IMPORTANT!! 33.>abcdefghijklmnopqrstuvwxyz 33E>i 0 34E>i 12 35E>i 123 36E>i 1234 37E>p 33 37 33.>abcdefghijklmnopqrstuvwxyz 34.>0 35.>12 36.>123 37.>1234 37E>ib 123abc 38E>p 33 38 33.>abcdefghijklmnopqrstuvwxyz 34.>0 35.>12 36.>123 37.>123abc 38.>1234 38E> > <CR> - INSERT mode By transmitting a <CR>, ule is toggled into INSERT mode. All subsequent lines are inserted into the file after the present line until a single <CR> is entered and ule is toggled back into EDIT mode. EG: 33.>abcdefghijklmnopqrstuvwxyz 33E> 33I>0 34I>01 35I>012 36I>0123 37I> 37E>p 33 37 33.>abcdefghijklmnopqrstuvwxyz 34.>0 35.>01 36.>012 37.>0123 37E>
>>> j - JOIN j JOIN the next line to the end of the present line inserting one space between the end and the first nonblank position of the next line. EG: 33.>if (x=0) 34.>then y=0; 33.>if (x=0) 33E>j - join line 34 to 33. 33.>if (x=0) then (y=0); 33E>
>>> k - KOPY (DITTO) k [#1 [#2]] Kopy the present line, or line #1, or lines #1 through #2 to the present position of the edited file. EG: k - duplicate present line k 10 - duplicate line 10 k 10 20 - duplicate lines 10 thru 20 70.> else if (command=='e') ecommand(); 70E>k 71.> else if (command=='e') ecommand(); 71E>k 66 72.> if (command=='a') acommand(); 72E>k 68 70 73.> else if (command=='c') ccommand(); 74.> else if (command=='d') dcommand(); 75.> else if (command=='e') ecommand(); 75E>
>>> l - LOCATE l[ ,# | *# | a ] [QSTRING] Locate the next line that contains STRING, or all of the next ,# lines, or the next *# occurrences of STRING, or all (a) occurs. If STRING spaces or (') or (") enclosed STRING in (") or ('). EG: l - repeat last locate. l? - display last locate. l move - locate next move l,20 copy( - locate copy( for next 20 lines l*10 strcpy( - locate next 10 occurances of strcpy( l " isn't " - locate next Bisn'tB la '"HELP"' - locate all "HELP" 229.> char bs[80]; 229E>l int 233.> {printf("%s\n",bsave); 233E>l,100 270.> printf("No Break\n"); 273.>int ccommand() 275.> int i,j,k, l,m,x,in,lcf,lct,lw,i1,i2,i3,cont,tb; 279.> {printf("%s\n",csave); 333E>l*5 381.> {printf("No Changes\n");} 390.>int dcommand() 392.> int i,j,k; 433.>int ecommand() 441.>int fcommand() 441E>
>>> m - MOVE m #1 [#2] Move line #1, or lines #1 through #2 after the present position in the edited file. EG: m 21 - move line 21 to present location m 81 100 - move lines 81 thru 100 to present location 76.> if (command=='a') acommand(); 76E>m 68 70 74.> else if (command=='d') dcommand(); 75.> else if (command=='e') ecommand(); 76.> else if (command=='f') fcommand(); 76E>
>>> n - NEXT n [#] Next line or, go forward # lines. EG: n - next line n 20 - go to the next 20th line 66.> if (command=='a') acommand(); 66E>n 67.> else if (command=='b') bcommand(); 67E>n 68.> else if (command=='c') ccommand(); 68E>n 10 78.> else if (command=='m') mcommand(); 78E>
>>> o - OLD o FILENAME Load FILENAME into the editing buffer. EG: o test.c load test.c o report.cob load report.c 0E>oule.c >>>>>>>> FILE :ule.c >>>>>>>> # Lines : 1369 0E> NOTE: If you have modified the present file without saving or writing it you will get a warning: 1E>oule.c >>> FILE <hiworld.c> Not Saved: Enter S/s to Save; C/c to Cancel:
>>> p - PRINT p[ p | a | h | t | z | b | u ] [#1 [#2]] Print a (pp) page =20 lines, or (pa) all lines, or (ph) head the first 20 lines, or (pt) tail the last 20 lines, or (pz) zoom 10 lines before and after the present line, or (pb) back 20 lines preceding the present line, or (pu) back 40 thru 20 lines (PgUp emulation), or #1 lines, or lines #1 through #2. If the p is immediately followed by n, it means "print no line numbers". The n can be combined with any other option. p10 - print next 10 lines p 11 20 - print lines 11 thru 20 pp - print page - next 20 lines pl - print long - next 34 lines pa - print all - entire file ph - print head - first 20 lines of file pt - print tail - last 20 lines of file pz - print zoom - 10 lines before and after present line pb - print back - 20 lines before present line pu - print up - PgUp emulation (n-40 thru n-20) an example session: (we will not example pa - print all!) /usr/accts/oracle >ule ule.c >>>> Holg's ule (Unix Line Editor) V2.0 (04/02/99) >>>> 111111 Lines Maximum! >>>>>>>> FILE :ule.c >>>>>>>> # Lines : 1376 0E>p 5 /* print 5 lines 1.>/* ule - Copyright (c) 1998 - mark holgerson */ 2.> 3.>#include <stdio.h> 4.>#include <string.h> 5.> 5E>pn 1 5 /* print first 5 lines "no line numbers" /* ule - Copyright (c) 1998 - mark holgerson */ #include <stdio.h> #include <string.h> 5E>p 11 16 /* print lines 11 thru 16 11.> 12.>char command; /* user command (a-z,#, ... */ 13.>char tabc; /* tab char */ 14.>int tabn,tabs[10]; /* # of tabs, tab stops */ 15.>int nlines,nhits; /* lines 2 search,find, used by locate,find,etc */ 16.>char f[80],ver[80]; /* file name, ule version # */ 16E>pp /* print a page (20 lines) 16.>char f[80],ver[80]; /* file name, ule version # */ 17.>char u[MAXLENGTH]; /* user input command line */ 18.>char w[MAXLENGTH]; /* work area */ 19.>char us1[MAXLENGTH]; /* returned from parcing command line */ 20.>char us2[MAXLENGTH]; /* " */ 21.>char us3[MAXLENGTH]; /* " */ 22.>char bsave[80], /* memory of last break */ 23.> csave[80], /* change */ 24.> fsave[80], /* find */ 25.> hsave[80], /* hack */ 26.> lsave[80]; /* locate */ 27.>char *v; /* work holding area */ 28.>char *b[MAXLINES]; /* buffer holding line pointers */ 29.>char **vb; /* virtual buffer used by move and kopy(ditto) */ 30.>int endsw; /* end user switch */ 31.>int fmodsw; /* file modified switch */ 32.>int n; /* current line pointer */ 33.>int e; /* end of file pointer */ 34.> 35.>main(argc,argv) 36.>int argc; 36E>ph /* print head of file, first 20 lines 1.>/* ule - Copyright (c) 1998 - mark holgerson */ 2.> 3.>#include <stdio.h> 4.>#include <string.h> 5.> 6.>#define MAXLINES 111111 /* set maxlines for editor */ 7.> /* i set 99999 for unix 8.> 4000 for PC */ 9.>#define MAXLENGTH 255 /* set maxlength of editorline*/ 10.> /* 255 should do it */ 11.> 12.>char command; /* user command (a-z,#, ... */ 13.>char tabc; /* tab char */ 14.>int tabn,tabs[10]; /* # of tabs, tab stops */ 15.>int nlines,nhits; /* lines 2 search,find, used by locate,find,etc */ 16.>char f[80],ver[80]; /* file name, ule version # */ 17.>char u[MAXLENGTH]; /* user input command line */ 18.>char w[MAXLENGTH]; /* work area */ 19.>char us1[MAXLENGTH]; /* returned from parcing command line */ 20.>char us2[MAXLENGTH]; /* " */ 20E>pt /* print tail of file, last 20 lines 1356.>int gethitslines() 1357.> { 1358.> int i,j,k; 1359.> char s[80]; 1360.> nlines=e; 1361.> nhits=1; 1362.> if (u[0]=='a' || u[0]=='A') 1363.> {nlines=e+2; nhits=e+2; strcpy(u,&u[1]); return;} 1364.> if (!(u[0]==',' || u[0]=='*')) return; 1365.> i=1; 1366.> if (!('0' <= u[i] && u[i] <= '9')) return; 1367.> while ('0' <= u[i] && u[i] <= '9') i++; 1368.> for (j=1; j<=i; j++) s[j-1]=u[j]; 1369.> s[j-1]='\0'; 1370.> k=xatoi(s); 1371.> if (u[0]==',') 1372.> {nlines=k; nhits=e;} 1373.> else 1374.> {nhits=k; nlines=e;} 1375.> strcpy(u,&u[j-1]); 1376.> } 1376E>1000 1000.> printf( ">>>>>>>> Tabs :%c",tabc); 1000E>pz /* zoon out + and - 10 lines from present line 990.> 991.>int vcommand() 992.> { 993.> int i; 994.> if (strcmp(u,"")!=0) 995.> {ercommand(); return;} 996.> printf("\n>>>>>>>> ule VER :%s\n",ver); 997.> printf( ">>>>>>>> Copyright (c) 1998 - mark holgerson\n"); 998.> printf( ">>>>>>>> FILE :%s\n",f); 999.> printf( ">>>>>>>> # Lines :%6d\n",e); 1000.> printf( ">>>>>>>> Tabs :%c",tabc); 1001.> if (tabn>0) 1002.> {for (i=1; i<=tabn; i++) printf(" %d",tabs[i]);} 1003.> printf("\n"); 1004.> printf( ">>>> Last Break :%s\n",bsave); 1005.> printf( ">>>> Last Change :%s\n",csave); 1006.> printf( ">>>> Last Hack :%s\n",hsave); 1007.> printf( ">>>> Last Locate :%s\n",lsave); 1008.> printf( ">>>> Last Find :%s\n\n",fsave); 1009.> 1010.> } 1010E>1100 1100.> {k++; strcpy(b[n],&b[n][1]);} 1100E>pb /* print back 20 lines from present line 1080.> if (u[0]=='a' || u[0]=='A') 1081.> {if (n==1) {ercommand(); return;} 1082.> i=0; while(b[n-1][i]==' ') i++; 1083.> j=0; while(b[n ][j]==' ') j++; 1084.> k=i-j; 1085.> } 1086.> else 1087.> {ercommand(); return;} 1088.> strcpy(w,""); 1089.> k=imin(k,256-strlen(b[n])); 1090.> if (k>0) 1091.> {for (i=0; i<k; i++) strcat(w," "); 1092.> strcat(w,b[n]); 1093.> free(b[n]); 1094.> valloc1(strlen(w)); 1095.> strcpy(v,w); 1096.> b[n]=v; 1097.> } 1098.> if (k<0) 1099.> {while (k<0 && b[n][0]==' ') 1100.> {k++; strcpy(b[n],&b[n][1]);} 1100E>pu /* print lines -40 thru -20 from present line; simulates PgUp 1060.> printf("\n>>> FILE <%s> %d Lines Written\n\n",us1,to-fr+1); 1061.> fmodsw=0; 1062.> } 1063.> 1064.>int xcommand() 1065.> {int i,j,k; 1066.> if (n==0) {ercommand(); return;} 1067.> k=0; 1068.> if (strcmp(u,"")==0) k=1; 1069.> else 1070.> if (u[0]=='-') 1071.> {k=0; 1072.> while (u[0]=='-') {k--; strcpy(u,&u[1]);} 1073.> } 1074.> else 1075.> if (u[0]=='x' || u[0]=='X') 1076.> {k=1; 1077.> while (u[0]=='x' || u[0]=='X') {k++; strcpy(u,&u[1]);} 1078.> } 1079.> else 1080.> if (u[0]=='a' || u[0]=='A') 1080E> . .
>>> q - QUIT q Quit the editing session. NOTE: Quitting a modified file gives a warning: 1.>main() 1E>q >>> FILE <hiworld.c> Not Saved: Enter S/s to Save; C/c to Cancel:
>>> r - REPLACE rBLINE r@STRING r^STRING r#STRING Replace present line with LINE, Where B is a blank in column 2. The r@ means replace any character in the present line or beyond with the respective character in LINE. Use @ to enter a blank character. The r^ means insert the STRING into the line at its first non-blank point (with ^ counting as blanks). The r# means pound or delete the corresponding non blank characters. EG: 33.>0123456789 33E>r abcdefghijklmnopqrstuvwxyz - replace line 33.>abcdefghijklmnopqrstuvwxyz 33.>abcdefghijklmnopqrstuvwxyz 33E>r@V V V V V @ 0 - replace vowels, blank x, add 0 33.>VbcdVfghVjklmnVpqrstVvw yz 0 33.>VbcdVfghVjklmnVpqrstVvw yz 0 33E>r^ here - squeeze here here. 33.>VbcdVfghhereVjklmnVpqrstVvw yz 0 33.>VbcdVfghhereVjklmnVpqrstVvw yz 0 33E>r^ ^-middle-^ - squeeze B-middle-B in middle 33.>VbcdVfghhereVjklm -middle- nVpqrstVvw yz 0 33.>VbcdVfghhereVjklm -middle- nVpqrstVvw yz 0 33E>r#x x x xxx - remove respective characters 33.>bcdfghherejklm -mid- nVpqrstVvw yz 0 33E>
>>> s - SAVE s[q] Save edited file. EG: s - save file sq - save and quit. 1.>main() 1E>s >>> FILE <hiworld.c> 4 Lines Written 1E>sq >>> FILE <hiworld.c> 4 Lines Written F:\0ULE >
>>> t - set TAB character and tabs t C #1 [#2 [#3 ... [#10]]] Set LEADING tab character C and tab stops #1, #2, .. #10. ONLY leading tabs are recognized, imbedded tabs are simply treated as data. Tab characters are recognized by the Insert, Replace, and Find commands, as well as lines entered in INSERT mode. t ] 6 11 16 21 t ; 8 12 72 >>> FILE <1.pl> Not Saved: Enter S/s to Save; C/c to Cancel: F:\0ULE >ule 1.pl >>>> Holg's ule (Unix Line Editor) V1.3x experimental!? (03/09/98) >>>> 4000 Lines Maximum! >>>>>>>> FILE :1.pl >>>>>>>> # Lines : 0 0E>t ] 3 6 9 0E>i open(OLD,"list"); 1E>i while (<OLD>) { 2E>i ]if (/lost/) { 3E>i ]]print "found\n"; 4E>i ]} 5E>i } 6E>pa 1.>open(OLD,"list"); 2.>while (<OLD>) { 3.> if (/lost/) { 4.> print "found\n"; 5.> } 6.>} 6EOF> 0.> 0E>sq >>> FILE <1.pl> 6 Lines Written F:\0ULE >
>>> u - Unused.
>>> v - ule VALUES v Displays the file being edited, # of lines, values of last break, locate, find, change, and hack commands. EG: 0E>v >>>>>>>> ule VER :V1.3x experimental!? (03/09/98) >>>>>>>> Copyright (c) 1998 - mark holgerson >>>>>>>> FILE :ule.c >>>>>>>> # Lines : 1369 >>>>>>>> Tabs : >>>> Last Break : >>>> Last Change : >>>> Last Hack : >>>> Last Locate : >>>> Last Find : 0E> - just a memory jogger
>>> w - WRITE w FILENAME [#1 #2] Write the edited file (or the range #1 through #2 of lines) to file FILENAME. EG: w save0001 w heading 1 2 0E>w2.pl >>> FILE <2.pl> 6 Lines Written 0E> NOTE: writing to an existing file will result in a warning: 0E>w2.pl ??? FILE <2.pl> Exists: Enter O/o to Overwrite; C/c to Cancel:
>>> x - SPACE x[ xxx ... | --- ... | a ] Space fill the present line xxx spaces to the right, or space delete (-) spaces, or (a) align the present line with the previous line. EG: x - move line one space right xxx - move line three spaces right x ----- - move line five spaces left xa - align line with previous line 8.> } 8E>i if (/lost/) { 9E>i print "found!\n"; 10E>i print "hurray!\n"; 11E>i } 12E>-2 10.> print "found!\n"; 10E>xxx 10.> print "found!\n"; 10E>n 11.> print "hurray!\n"; 11E>xa 10.> print "found!\n"; 11.> print "hurray!\n"; 11E>p 9 12 9.> if (/lost/) { 10.> print "found!\n"; 11.> print "hurray!\n"; 12.> } 12E>x- 12.> }
>>> y - Unused.
>>> z - ZAP z[z] Zap (erase) workarea. zz foregoes the comfirm prompt. EG: z zz 12E>z >>> ZAP - Erase Workarea - Enter Y/y to Erase: 12E>zz 0E>
>>> # - NUMBER # Goto line number #. 66.> if (command=='a') acommand(); 66E>76 76.> else if (command=='k') kcommand(); 76E>86 86.> else if (command=='u') ucommand(); 86E>5000 1369.> } 1369EOF> 0.> 0E>
>>> +/- PLUS/MINUS +/-[#] Move forward/backward 1 or # lines. EG: + - next line - - previous line +10 - go forward 10 lines -20 - go back 20 lines 66.> if (command=='a') acommand(); 66E>+ 67.> else if (command=='b') bcommand(); 67E>- 66.> if (command=='a') acommand(); 66E>+20 86.> else if (command=='u') ucommand(); 86E>-10 76.> else if (command=='k') kcommand(); 76E>
>>> ! - SCALE Prints a scale (to see whats in what column). EG: ! - results: 66.> if (command=='a') acommand(); 66E>! > 1 2 3 4 5 6 >1234567890123456789012345678901234567890123456789012345678901234567 66E>
WARNING MESSAGES:
Appropriate prompts are issued when quitting without saving, opening a new file without saving, and writing to an existing file. EG; a session: /usr/accts/oracle >ule x >>>> Holg's ule (Unix Line Editor) V2.0 (04/02/99) >>>> 111111 Lines Maximum! >>>>>>>> FILE :x >>>>>>>> # Lines : 158 0E>wx /* write to an existing file ??? FILE <x> Exists: Enter O/o/Y/y to Overwrite; C/c to Cancel:c 0E>1 1.>rubber baby buggie bumpers. 1E>c /./!/ /* make a change to the file 1.>rubber baby buggie bumpers! 1E>q /* quit the file without accounting for the changes to file x >>> FILE <x> Not Saved: Enter S/s/Y/y to Save; C/c to Cancel:c 1E>oy /* load a old file y without accounting for the changes to file x >>> FILE <x> Not Saved: Enter S/s/Y/y to Save; C/c to Cancel:c 1E>
ERROR MESSAGE:
Whenever (If ever?) you make a syntax error in ule, you will be greeted by: 0E>^ look at me i are smart! - a syntax error! ??? -- You want fries with that? -- ??? 0E> Look i am not a mind reader, i have no idea of whats going on in that pea-brain of yours, i only know that i dont know, and under the circumstances thats as good a responce as any.
GOOD LUCK!
Home