home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume39 / cwish / part01 < prev    next >
Encoding:
Text File  |  1993-09-22  |  58.4 KB  |  1,780 lines

  1. Newsgroups: comp.sources.misc
  2. From: hm@hcshh.hcs.de (Hellmuth Michaelis)
  3. Subject: v39i097:  cwish - Window Shell / Filemanager v1.00, Part01/04
  4. Message-ID: <csm-v39i097=cwish.111232@sparky.Sterling.COM>
  5. X-Md4-Signature: 60d76d82031cb3aaf968e80d770808d2
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Reply-To: hm@hcshh.hcs.de
  8. Organization: HCS Hanseatischer Computerservice GmbH
  9. Date: Wed, 22 Sep 1993 16:14:02 GMT
  10. Approved: kent@sparky.sterling.com
  11.  
  12. Submitted-by: hm@hcshh.hcs.de (Hellmuth Michaelis)
  13. Posting-number: Volume 39, Issue 97
  14. Archive-name: cwish/part01
  15. Environment: HP-UX, 386BSD, NETBSD, ANSI-C, SYSV-CURSES
  16.  
  17. Cwish is an easy to use tool for traveling through the filesystem,
  18. either for doing administrative work or as a shell replacement.
  19. I also use it frequently to browse through CDROM's, a special mode
  20. is available to handle untranslated ISO 9660 filenames.
  21.  
  22. It depends on a System-V curses library. If there is none available
  23. with your system (i.e. 386BSD), I recommend getting "ncurses", which
  24. is available from netcom.com:pub/zmbenhal.  The author is Zeyd M. 
  25. Ben-Halim (zmbenhal@netcom.com) - I use it for running cwish on 386BSD.
  26.  
  27. Cwish has been tested with Hewlett-Packard Terminals such as the 2392
  28. and 70092, with DEC Terminals VT100 and VT220 and with the 386BSD
  29. console drivers pccons and pcvt.
  30.     
  31. If you need help with cwish, just ask!
  32.  
  33. Hellmuth Michaelis    HCS Hanseatischer Computerservice GmbH    Hamburg, Europe
  34. -----------
  35. #! /bin/sh
  36. # This is a shell archive.  Remove anything before this line, then feed it
  37. # into a shell via "sh file" or similar.  To overwrite existing files,
  38. # type "sh file -c".
  39. # Contents:  README commandline.c header.c wish.1
  40. # Wrapped by kent@sparky on Wed Sep 22 10:49:57 1993
  41. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  42. echo If this archive is complete, you will see the following message:
  43. echo '          "shar: End of archive 1 (of 4)."'
  44. if test -f 'README' -a "${1}" != "-c" ; then 
  45.   echo shar: Will not clobber existing file \"'README'\"
  46. else
  47.   echo shar: Extracting \"'README'\" \(5868 characters\)
  48.   sed "s/^X//" >'README' <<'END_OF_FILE'
  49. X================================================================================
  50. X#                                                                              #
  51. X#        wish - user friendly windowing shell for character terminals          #
  52. X#        ------------------------------------------------------------          #
  53. X#                                                                              #
  54. X#            Release 1.00  (First Public Release)  September 1993              #
  55. X#                                                                              #
  56. X#                 Written and (c) Copyright 1988-1993 by                       #
  57. X#                        Hellmuth Michaelis (hm@hcshh.hcs.de)                  #
  58. X#                        Eggerstedtstr. 28                                     #
  59. X#                        22765 Hamburg                                         #
  60. X#                        Germany                                               #
  61. X#                                                                              #
  62. X#        See the file COPYING for restriction and warranty information         #
  63. X#                                                                              #
  64. X================================================================================
  65. X
  66. XYes, i know there is another program floating around called "wish", but i use
  67. Xit now for so long that i am not going to change it's name to something else!
  68. X
  69. XWish is an easy to use tool for travelling through the filesystem, either for
  70. Xdoing administrative work or as a shell replacement.
  71. X
  72. XIt was rewritten several times, a fact which is noticable in many dark corners
  73. Xof the source, flames to /dev/null please!
  74. X
  75. XThe code is neither beautiful nor elegant, as are the underlying data-
  76. Xstructures, so this is definitely NOT usable for an intro class into device
  77. Xindependant programming - it just does the job for many years now and the
  78. Xusers (yes, REAL users!) are satisfied with it.
  79. X
  80. XIt is now curses based, with the exception of two areas of terminal handling:
  81. X- the first being the access of alternate character sets, which is used for
  82. X  drawing horizontal lines across the screen, and
  83. X- second, the access of function keys in general (and HP-terminal function
  84. X  keys in special).
  85. X
  86. XBefore you cry, there is no alternate character handling and function key
  87. Xlabel handling available in the current version of HP-UX's curses (9.0).
  88. X
  89. XWhat i did was, that i programmed "around" curses, which is a very bad thing
  90. Xfor portability and other reasons - i know, but i did not found any other way.
  91. X
  92. XI think, i found failsafe methods in order to run wish on other than the 
  93. Xtested terminals, but due to the lack of appropriate hardware, i tested it
  94. Xonly on HP and DEC terminals or clones or terminal emulation packages
  95. Xemulating one of the before mentioned.
  96. X
  97. XIf you get wish to run on some other terminals (Wyse, Qume, Televideo etc.)
  98. Xplease tell me !
  99. X
  100. X
  101. XHISTORY
  102. X--------------------------------------------------------------------------------
  103. X
  104. XRelease        Changes/Features
  105. X-------        ----------------------------------------------------------------
  106. X1.00        First public release to comp.sources.misc
  107. X
  108. X
  109. XINSTALLATION
  110. X--------------------------------------------------------------------------------
  111. X
  112. XHP-UX:
  113. X    You need a ANSI-C compiler to compile everything. You should have no
  114. X    problems using the 8.0 and 9.0 compiler or GCC from the Free Software
  115. X    Foundation. Wish does not compile with the crippled 9.0 compiler.
  116. X
  117. X    Copy Makefile.hpux to Makefile and execute make. You should
  118. X    have no problems compiling wish.
  119. X
  120. X    I had some problems with terminfo entries for "unsupported" terminals
  121. X    under HP-UX 8.0, contact me if you need help.
  122. X
  123. X    "make install" installs wish to /usr/local/bin, "make man-hpux"
  124. X    installs the manual page to /usr/local/man/man1/wish.1.
  125. X
  126. X
  127. X386BSD:
  128. X    Zeyd M. Ben-Halim (zmbenhal@netcom.com) rewrote Pavel Curtis'
  129. X    ncurses library and made it available for 386BSD and Linux.
  130. X    
  131. X    This library is needed in order to get wish up and running on
  132. X    386BSD, NetBSD and Linux.
  133. X
  134. X    It is available from netcom.com:pub/zmbenhal.
  135. X
  136. X    Uncomment the appropriate Makefile-entry and execute make. You should
  137. X    have no problems compiling wish.
  138. X
  139. X    "make install" installs wish to /usr/local/bin, "make man-386bsd"
  140. X    installs the manual page to /usr/local/man/cat1/wish.0.
  141. X
  142. X
  143. XOTHER:
  144. X    You are on your own! I will be glad to get Makefile entries and/or
  145. X    diffs for other machines, if you need help, get in touch with me!
  146. X
  147. X
  148. X
  149. XWYSIWYG - WHAT YOU SHARE IS WHAT YOU GET
  150. X--------------------------------------------------------------------------------
  151. X
  152. XPLEASE, if you fix bugs, add features, hack this program to work on your
  153. Xterminal and/or operating system or simply don't get it up and running, get
  154. Xin contact with me!
  155. X
  156. XThe code is far from being perfect, YOU are very welcome to enhance it !
  157. X
  158. XPlease mail bug reports/fixes, suggestions, enhancements & diffs to 
  159. X
  160. X            hm@hcshh.hcs.de
  161. X
  162. XI will support this program as my time permits it, feel free to contact me!
  163. X
  164. XThank You!
  165. X
  166. X
  167. XKNOWN BUGS
  168. X-------------------------------------------------------------------------------
  169. X
  170. Xtoo much ...
  171. X
  172. X
  173. XTESTED TERMINALS
  174. X--------------------------------------------------------------------------------
  175. X
  176. XDEC VT100           no function keys, have to use escape + number
  177. XDEC VT220           F1 .. F8 mapped to F6 .. F13
  178. XHP2392A             slooow, but ok
  179. XHP700/92            ok, but very small font
  180. XWRQ R1+             nice, fast & easy
  181. XWRQ R2+             nice, fast & easy, F1 .. F8 mapped to F6 .. F13
  182. X386BSD pcvt         fully supported
  183. X386BSD pc3          supported
  184. X
  185. X
  186. XGood Luck and Have Fun !
  187. X
  188. XHellmuth
  189. X
  190. Xe-mail:    hm@hcshh.hcs.de (...mcsun!unido!hcshh!hm)
  191. Xs-mail:    c/o HCS GmbH, Oldesloer Str 97-99, 22457 Hamburg, Germany
  192. Xtel:    +49/40/55903-0 or +49/40/55903-170    (business)
  193. Xfax:    +49/40/5591486                (business)
  194. Xtel:    +49/40/384298                (private)
  195. END_OF_FILE
  196.   if test 5868 -ne `wc -c <'README'`; then
  197.     echo shar: \"'README'\" unpacked with wrong size!
  198.   fi
  199.   # end of 'README'
  200. fi
  201. if test -f 'commandline.c' -a "${1}" != "-c" ; then 
  202.   echo shar: Will not clobber existing file \"'commandline.c'\"
  203. else
  204.   echo shar: Extracting \"'commandline.c'\" \(18934 characters\)
  205.   sed "s/^X//" >'commandline.c' <<'END_OF_FILE'
  206. X/*---------------------------------------------------------------------------*
  207. X *
  208. X *                  wish - windowing user friendly shell
  209. X *                 --------------------------------------
  210. X *
  211. X *              (c) Copyright Hellmuth Michaelis 1989 - 1993
  212. X *
  213. X *                  Eggerstedtstr. 28
  214. X *                  22765 Hamburg
  215. X *                  Germany
  216. X *
  217. X *                  Tel:    +49 / 40 / 384298    (private)
  218. X *                  Tel:    +49 / 40 / 55903-170 (at work)
  219. X *                  e-mail: hm@hcshh.hcs.de
  220. X *
  221. X *           All rights are reserved except as explicitly granted
  222. X *                  by written permission of the author.
  223. X *
  224. X *             See the file COPYING, distributed with wish, for
  225. X *                  restriction and warranty information
  226. X *
  227. X *---------------------------------------------------------------------------*
  228. X *
  229. X *      last edit-date: [Mon Aug 30 12:27:37 1993]
  230. X *
  231. X *      -hm     debugging "more" output
  232. X *      -hm     separate sys-call function exec_command
  233. X *      -hm     time suspend/resume
  234. X *      -hm     nochng flag introduced
  235. X *      -hm     current dir preserve when cd ..
  236. X *      -hm     compress / gzip support
  237. X *      -hm     tar support
  238. X *      -hm     no space on echo to first cmdline pos
  239. X *      -hm     fixed no space bug ....
  240. X *      -hm     curdir debugging
  241. X *      -hm     housekeeping
  242. X *      -hm     cd bugfix, cdmount did not do what it should
  243. X *      -hm     new routine ending to support multiple extensions
  244. X *      -hm     cd with wildcards
  245. X *      -hm     cdrom special processing for filenames containing ';'
  246. X *
  247. X *----------------------------------------------------------------------------*/ 
  248. X
  249. X#include "wish.h"               /* local includes */
  250. X
  251. Xstatic int waitcr = 0;          /* do not wait for cr */
  252. Xstatic int reread = 0;          /* reread current dir */
  253. Xstatic int nochng = 0;          /* nothing has changed */
  254. Xstatic int preserve = PRES_NO;  /* preserve highlighted position */
  255. Xstatic char curdirb[MAXPATHLEN+1];
  256. Xstatic char *curdir = curdirb;  /* current dir to preserve if cd .. */
  257. X
  258. Xstatic char *str_nxtw(char *, int); /* returns a pointer to the next word in string */
  259. Xstatic char *ending(char *filename);
  260. Xstatic char *adjustfn(register char *name);
  261. X
  262. X/*---------------------------------------------------------------------------*
  263. X *      echo the current highlighted filename onto the commandline
  264. X *---------------------------------------------------------------------------*/
  265. Xvoid name_echo(void)
  266. X{
  267. X        char *ptr;              /* temp ptr */
  268. X
  269. X        ptr = &(cur_file->onam[1]);     /* ptr = current filename */
  270. X                                        /* check for delimiter */
  271. X        
  272. X        if( (!(cr_on_files())) && (cbuff[curcol()-1] != SPACE) )
  273. X                cmdline(SPACE);         /* if none, insert one */
  274. X                
  275. X        ptr = adjustfn(ptr);
  276. X
  277. X        while((*ptr) && ((cmdline(*ptr++)) == GOOD))
  278. X                ;
  279. X}
  280. X
  281. X/*---------------------------------------------------------------------------*
  282. X *      returns a pointer to the next word in string
  283. X *---------------------------------------------------------------------------*/
  284. Xstatic char *str_nxtw(char *str, int frst)
  285. X{
  286. X        char *r;
  287. X        
  288. X        if((str == NULL) || (*str == '\0'))
  289. X                return(NULL);
  290. X
  291. X        r = str;
  292. X        
  293. X        if(frst)
  294. X        {
  295. X                while(*r == SPACE)      /* while leading delimiters */
  296. X                        r++;
  297. X                if(*r != '\0')
  298. X                        return(r);      /* first non-space char */
  299. X                else
  300. X                        return(NULL);
  301. X        }
  302. X        else
  303. X        {
  304. X                while((*r != SPACE) && (*r != '\0')) /* find space */
  305. X                        r++;
  306. X                if(*r == '\0')          /* test for end of string */
  307. X                        return(NULL);
  308. X                while(*r == SPACE)      /* while there are delimiters */
  309. X                        r++;
  310. X                if(*r != '\0')
  311. X                        return(r);      /* first non-space char */
  312. X                else
  313. X                        return(NULL);   /* end of string */
  314. X        }
  315. X}
  316. X
  317. X/*---------------------------------------------------------------------------*
  318. X *      expand the selection character onto the commandline
  319. X *---------------------------------------------------------------------------*/
  320. Xvoid expsel(char *p)
  321. X{
  322. X        char rest[512];         /* save buffer */
  323. X        struct onefile *info;   /* our file struct ptr */
  324. X        int i;                  /* free space counter in cbuff */
  325. X        register char *fnp;     /* for filename conversion */
  326. X
  327. X        strcpy(rest,p+1);       /* save right half of cbuff after EXPSEL-char */
  328. X
  329. X        if(*(p-1) != SPACE)     /* check for delimiter present */
  330. X        {
  331. X                *p = SPACE;
  332. X                p++;
  333. X        }
  334. X        
  335. X        i = (p - cbuff) + strlen(rest); /* count of already occupied chars */
  336. X        
  337. X        info = first;           /* first in list */
  338. X
  339. X        *p = '\0';              /* terminate left half of cbuff */
  340. X        
  341. X        while(info)             /* scan through dir - list */
  342. X        {
  343. X                if(info->tag)   /* search for tagged files */
  344. X                {
  345. X                        fnp = adjustfn(&(info->onam[1]));
  346. X                        
  347. X                        if(((strlen(fnp))+1) < (HISLNLEN - i))
  348. X                        {
  349. X                                /* we have enough space  */
  350. X
  351. X                                i += (strlen(fnp)+1);
  352. X                                strcat(cbuff, fnp);
  353. X                                strcat(cbuff," ");
  354. X                        }
  355. X                }
  356. X                info = info->next;      /* next entry */
  357. X        }
  358. X        strcat(cbuff,rest);     /* copy saved right half to generated part */
  359. X}
  360. X
  361. X/*---------------------------------------------------------------------------*
  362. X *      user has typed a <CR>
  363. X *---------------------------------------------------------------------------*/
  364. Xvoid handlecr(void)
  365. X{
  366. X        nochng = 0;             /* anything may change on screen */
  367. X        preserve = PRES_NORM;   /* nothing to preserve */
  368. X        
  369. X        if(cr_on_files())       /* nothing on commandline, process high- */
  370. X        {                       /*  lighted filename field */
  371. X                h_files();      /* cr on a filename */
  372. X        }
  373. X        else    /* something in commandlinebuffer */
  374. X        {
  375. X                h_line();       /* commandline */
  376. X        }
  377. X
  378. X        if(waitcr && opt_return)        /* wait for <cr> being hit */
  379. X        {
  380. X                move(LINES-1, 0);       /* last line */
  381. X                clrtoeol();             /* clear it */
  382. X                move(LINES-1, 0);       /* last line */
  383. X                attrset(A_REVERSE);             /* highlight on */
  384. X                addstr("Press any key to continue ...");
  385. X                attroff(A_REVERSE);             /* highlight on */              
  386. X                refresh();
  387. X                getch();
  388. X                move(LINES-1, 0);       /* last line */
  389. X                clrtoeol();             /* clear it */
  390. X                touchwin(stdscr);
  391. X                wnoutrefresh(stdscr);
  392. X        }
  393. X        header();       /* new header */
  394. X        dis_hist();     /* display current history entry */
  395. X
  396. X        if(reread)      /* directory has to be re-read */
  397. X        {
  398. X                free_list();            /* free malloc'ed buffers */
  399. X                init_files(preserve, curdir);   /* yes, read current dir */
  400. X        }
  401. X        else
  402. X        {
  403. X                if(!nochng)
  404. X                        fresh_files();  /* just refresh window */
  405. X        }
  406. X        resume_time();          /* restart time display update */
  407. X        if(!nochng)
  408. X        {
  409. X                attribs(1);             /* new attributes */
  410. X                init_flabels();         /* fk-labels onto screen */
  411. X                update_all();           /* update all windows */
  412. X        }
  413. X        else
  414. X        {
  415. X                wrefresh(cmnd_w);
  416. X        }
  417. X}
  418. X
  419. X/*---------------------------------------------------------------------------*
  420. X *      user has typed <CR> and something is on commandline
  421. X *---------------------------------------------------------------------------*/
  422. Xvoid h_line(void)
  423. X{
  424. X        char *cptr = cbuff+3;   /* ptr to start of line after prompt */
  425. X        char *cp;               /* command ptr */
  426. X        char *ap;               /* argument ptr */
  427. X        char *ep;               /* expansion char ptr */
  428. X
  429. X        if((cp = str_nxtw(cptr,1)) == NULL)     /* just spaces on commandline ? */
  430. X        {       
  431. X                nochng = 1;
  432. X                errno = 0;                      /* yes ... */
  433. X                error("commandline empty ... ");
  434. X                waitcr = 0;
  435. X                reread = 0;
  436. X        }
  437. X        else if( (*cp == 'c') && (*(cp+1) == 'd') &&
  438. X                 ( (*(cp+2) == ' ') || (*(cp+2) == '\t') || (*(cp+2) == '\0') ) )
  439. X        {
  440. X                int ret;
  441. X                if((ap = str_nxtw(cp, 0)) == NULL)
  442. X                {
  443. X                        ret = chdir(envhome);   /* cd to home */
  444. X                }
  445. X                else
  446. X                {
  447. X                        char *ptr;
  448. X
  449. X                        if((ptr = (char *)index(ap, '.')) != NULL)
  450. X                        {
  451. X                                if(!(strncmp(ptr, "..", 2)))
  452. X                                {
  453. X                                        if(getcwd(curdir, MAXPATHLEN) == NULL)
  454. X                                                *curdir = '\0';
  455. X                                        preserve = PRES_DD;
  456. X                                }
  457. X                        }
  458. X                        ret = cd(ap);   /* cd to <dir> */
  459. X                }
  460. X
  461. X                if(ret == -1)
  462. X                {
  463. X                        nochng = 1;
  464. X                        error("changing directory failed - chdir() error");
  465. X                        waitcr = 0;
  466. X                        reread = 0;
  467. X                }
  468. X                else
  469. X                {
  470. X                        waitcr = 0;
  471. X                        reread = 1;
  472. X                }                       
  473. X        }
  474. X        else
  475. X        {
  476. X                if((ep = strchr((cbuff+3),EXPSEL)) != NULL)             
  477. X                        expsel(ep);             /* expand selection char */
  478. X
  479. X                exec_command(cbuff+3);
  480. X
  481. X                waitcr = 1;             /* wait for <cr> */
  482. X                reread = 1;             /* reread current dir */
  483. X        }
  484. X        save_line();                    /* save commandline to history */       
  485. X}
  486. X        
  487. X/*---------------------------------------------------------------------------*
  488. X *      user has typed <CR> and commandline is empty
  489. X *---------------------------------------------------------------------------*/
  490. Xvoid h_files(void)
  491. X{               
  492. X        preserve = PRES_NORM;
  493. X        
  494. X        if(cur_file->oprm[0] == 'd')    /* directories */
  495. X        {
  496. X                preserve = PRES_DD;
  497. X
  498. X                if(getcwd(curdir, MAXPATHLEN) == NULL)
  499. X                        *curdir = '\0';
  500. X
  501. X                if((chdir(&(cur_file->onam[1]))) == -1)
  502. X                {
  503. X                        nochng = 1;
  504. X                        error("changing directory to current selection failed - chdir() error");
  505. X                        reread = 0;     /* no need to re-read */
  506. X                }
  507. X                else
  508. X                {
  509. X                        reread = 1;     /* (re-) read (new) dir */
  510. X                }
  511. X
  512. X                waitcr = 0;             /* don't wait for <CR> */
  513. X        }
  514. X
  515. X        /* executables */
  516. X
  517. X        else if((cur_file->oprm[3] == 'x') ||
  518. X                (cur_file->oprm[6] == 'x') ||
  519. X                (cur_file->oprm[9] == 'x'))
  520. X        {
  521. X                sprintf(cbuff, "%s/%s", cur_path, &(cur_file->onam[1]));
  522. X
  523. X                exec_command(cbuff);            /* shell-call */
  524. X
  525. X                waitcr = 1;
  526. X                reread = 1;
  527. X        }
  528. X
  529. X        /* data files */
  530. X        else if((cur_file->oprm[1] == 'r') ||
  531. X                (cur_file->oprm[4] == 'r') ||
  532. X                (cur_file->oprm[7] == 'r'))                     
  533. X        {
  534. X                FILE *pfp;
  535. X                char *pp;
  536. X                char *fnp;
  537. X
  538. X                fnp = adjustfn(&(cur_file->onam[1]));
  539. X
  540. X                sprintf(cbuff, "cat %s/%s", cur_path, fnp);
  541. X                
  542. X                if((pp = ending(fnp)) != NULL)
  543. X                        strcat(cbuff, pp);
  544. X
  545. X                strcat(cbuff,"|");              /* pipe to pager */     
  546. X                strcat(cbuff, opt_more);        /* pager */
  547. X                
  548. X                suspend_time();         /* stop updating time */
  549. X                fini_flabels();         /* remove user labels */
  550. X                move(0, 0);             /* first line */
  551. X                touchwin(stdscr);       /* force */
  552. X                clear();                /* clear it */
  553. X                refresh();              /* update screen */
  554. X                savetty();              /* save tty-modes for resetty() */
  555. X                reset_shell_mode();     /* set tty to pre-curses values */
  556. X                
  557. X                if((pfp = popen(cbuff, "w")) == NULL)   /* exec */
  558. X                        error("cannot open pipe to PAGER");
  559. X                else
  560. X                {
  561. X                        if(pclose(pfp) == -1)
  562. X                                error("PAGER pclose error");
  563. X                }
  564. X
  565. X                resetty();              /* restore modes to curses operation */
  566. X
  567. X                reset_prog_mode();      /* set to curses values */
  568. X                
  569. X#ifdef CURSESBUG
  570. X                putp(keypad_xmit);      /* hp curses bug .. */
  571. X#endif
  572. X
  573. X                touchwin(cmnd_w);
  574. X                touchwin(fst_w);
  575. X                touchwin(file_w);
  576. X                if(opt_attrib)
  577. X                        touchwin(attr_w);
  578. X                if(opt_labels)
  579. X                        touchwin(flbl_w);
  580. X        
  581. X                resume_time();          /* restart updating time */
  582. X                waitcr = 0;             /* don't wait for <CR> */
  583. X                reread = 0;             /* reread dir */
  584. X        }
  585. X
  586. X        /* OOPS, whats this ?? */
  587. X        else
  588. X        {
  589. X                errno = 0;              /* no errno display */
  590. X                error("no exec/read permission found ....");
  591. X                flash();                /* no no .. */
  592. X                waitcr = 0;             /* don't wait for <CR> */
  593. X                reread = 0;             /* don't reread dir !!! */
  594. X        }
  595. X}
  596. X
  597. X/*---------------------------------------------------------------------------*
  598. X *      what to do with the file depending on ending
  599. X *---------------------------------------------------------------------------*/
  600. Xstatic char *ending(char *filename)
  601. X{
  602. X        int i;
  603. X        char *p;
  604. X
  605. X        static char *etab[][2] = {
  606. X                {".tar.Z",      "|compress -dfc|tar tvf -"},
  607. X                {".tar.z",      "|gzip -cdf|tar tvf -"},
  608. X                {".tar.gz",     "|gzip -cdf|tar tvf -"},
  609. X                {".tar",        "|tar tvf -"},
  610. X                {".Z",          "|compress -dfc"},
  611. X                {".z",          "|gzip -cdf"},
  612. X                {".gz",         "|gzip -cdf"},
  613. X                {NULL, NULL}
  614. X        };
  615. X
  616. X        /* see if filename contains a known extension and return the    */
  617. X        /* commandline string to decode that file                       */
  618. X
  619. X        for(i = 0; etab[i][0] != NULL; i++)
  620. X        {
  621. X                if( ((p = strstr(filename, etab[i][0])) != NULL) &&
  622. X                    (strlen(p) == strlen(etab[i][0])) )
  623. X                        return(etab[i][1]);
  624. X        }
  625. X        return(NULL);
  626. X}
  627. X
  628. X/*---------------------------------------------------------------------------*
  629. X *      edit the current file
  630. X *---------------------------------------------------------------------------*/
  631. Xvoid edit_current(void)
  632. X{
  633. X        char *fnp;
  634. X
  635. X        if(cur_file->oprm[0] == 'd')    /* directories */
  636. X                return;
  637. X
  638. X        fnp = adjustfn(&(cur_file->onam[1]));
  639. X        
  640. X        sprintf(cbuff,"%s %s/%s", opt_edit, cur_path, fnp);
  641. X
  642. X        exec_command(cbuff);            /* shell-call */
  643. X
  644. X        header();               /* new header */
  645. X        dis_hist();             /* display current history */
  646. X        fresh_files();          /* display files */
  647. X        attribs(1);             /* new attributes */
  648. X        init_flabels();         /* fk-labels onto screen */
  649. X        update_all();
  650. X        resume_time();          /* restart time display update */       
  651. X}
  652. X
  653. X/*---------------------------------------------------------------------------*
  654. X *      close current directory
  655. X *---------------------------------------------------------------------------*/
  656. Xvoid close_cdir(void)
  657. X{
  658. X        if(getcwd(curdir, MAXPATHLEN) == NULL)
  659. X                *curdir = '\0';
  660. X        
  661. X        if((chdir("..")) == -1)
  662. X        {
  663. X                error("changing directory to '..' dir failed - chdir() error");
  664. X                return;
  665. X        }
  666. X        else
  667. X        {
  668. X                header();               /* new header */
  669. X                free_list();            /* free malloc'ed buffers */
  670. X                init_files(PRES_DD, curdir);    /* yes, read current dir */
  671. X                attribs(1);             /* new attributes */
  672. X                init_flabels();         /* fk-labels onto screen */
  673. X        }
  674. X        update_all();
  675. X}
  676. X
  677. X/*---------------------------------------------------------------------------*
  678. X *      execute a command/program
  679. X *---------------------------------------------------------------------------*/
  680. Xvoid exec_command(char *cline)
  681. X{
  682. X        suspend_time();         /* no time display update */
  683. X        fini_flabels();         /* remove user labels */
  684. X        move(0, 0);             /* last line */
  685. X        touchwin(stdscr);       /* force */
  686. X        clear();                /* clear it */
  687. X        refresh();              
  688. X        savetty();              /* save tty-modes for resetty() */
  689. X        reset_shell_mode();     /* set to pre-curses values */
  690. X        system(cline);          /* shell-call */
  691. X        resetty();              /* restore modes to curses operation */
  692. X        reset_prog_mode();      /* set to curses values */
  693. X
  694. X#ifdef CURSESBUG
  695. X        putp(keypad_xmit);      /* hp curses bug .. */
  696. X#endif
  697. X
  698. X        touchwin(cmnd_w);
  699. X        touchwin(fst_w);
  700. X        touchwin(file_w);
  701. X        if(opt_attrib)
  702. X                touchwin(attr_w);
  703. X        if(opt_labels)
  704. X                touchwin(flbl_w);
  705. X}
  706. X
  707. X/*---------------------------------------------------------------------------*
  708. X *      adjust filename (cdrom, others ?)
  709. X *---------------------------------------------------------------------------*/
  710. Xstatic char *adjustfn(char *name)
  711. X{
  712. X    static char buffer[MAXPATHLEN];
  713. X    register char *bp = buffer;
  714. X    register char *sp = name;
  715. X    
  716. X    while(*sp)
  717. X    {
  718. X        if(iscdfs && (*sp == ';'))
  719. X            *bp++ = '\\';
  720. X        *bp++ = *sp++;
  721. X    }
  722. X    *bp = '\0';
  723. X    return((char *)buffer);
  724. X}
  725. X    
  726. X/*---------------------------------- EOF -------------------------------------*/
  727. END_OF_FILE
  728.   if test 18934 -ne `wc -c <'commandline.c'`; then
  729.     echo shar: \"'commandline.c'\" unpacked with wrong size!
  730.   fi
  731.   # end of 'commandline.c'
  732. fi
  733. if test -f 'header.c' -a "${1}" != "-c" ; then 
  734.   echo shar: Will not clobber existing file \"'header.c'\"
  735. else
  736.   echo shar: Extracting \"'header.c'\" \(6728 characters\)
  737.   sed "s/^X//" >'header.c' <<'END_OF_FILE'
  738. X/*---------------------------------------------------------------------------*
  739. X *
  740. X *                  wish - windowing user friendly shell
  741. X *                  ------------------------------------
  742. X *
  743. X *               Copyright (c) 1988-1993 Hellmuth Michaelis
  744. X *
  745. X *                  Eggerstedtstr. 28
  746. X *                  22765 Hamburg
  747. X *                  Germany
  748. X *
  749. X *                  Tel:    +49 / 40 / 384298    (private)
  750. X *                  Tel:    +49 / 40 / 55903-170 (at work)
  751. X *                  e-mail: hm@hcshh.hcs.de
  752. X *
  753. X *                          --------oOo--------
  754. X *
  755. X *   This program is free software; you can redistribute it and/or modify
  756. X *   it under the terms of the GNU General Public License as published by
  757. X *   the Free Software Foundation; either version 2 of the License, or
  758. X *   (at your option) any later version.
  759. X *
  760. X *   This program is distributed in the hope that it will be useful,
  761. X *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  762. X *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  763. X *   GNU General Public License for more details.
  764. X *
  765. X *   You should have received a copy of the GNU General Public License
  766. X *   along with this program; if not, write to the Free Software
  767. X *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  768. X *
  769. X *---------------------------------------------------------------------------*
  770. X *
  771. X *    Last Edit-Date: [Mon Aug 30 19:50:08 1993]
  772. X *
  773. X *    -hm    converting to curses and multiwindows
  774. X *    -hm    separation line in attribs window
  775. X *    -hm    vt220 support
  776. X *    -hm    show time in header
  777. X *    -hm    hpterm / zero pointers in hpux 9.0
  778. X *
  779. X *----------------------------------------------------------------------------*/
  780. X
  781. X#include "wish.h"
  782. X
  783. X/*---------------------------------------------------------------------------*
  784. X *    print a horizontal separation line based on delimiter-character
  785. X *---------------------------------------------------------------------------*/
  786. Xvoid sepaline(WINDOW *window)     
  787. X{
  788. X    int i = COLS;
  789. X    unsigned char delim;
  790. X    
  791. X    if(window == cmnd_w)
  792. X        wmove(window, 2, 0);
  793. X    else if(window == attr_w)
  794. X        wmove(window, 0, 0);
  795. X    else
  796. X        return;
  797. X
  798. X    if(opt_delimiter)
  799. X    {
  800. X        delim = opt_delimiter;        
  801. X    }
  802. X    else if(enter_alt_charset_mode && exit_alt_charset_mode &&
  803. X        *enter_alt_charset_mode && *exit_alt_charset_mode)
  804. X    {
  805. X        wattron(window, A_ALTCHARSET);
  806. X        switch(termtype)
  807. X        {
  808. X            case TERM_HP:    /* HEWLETT-PACKARD Terminals (2392,700/9x etc) */
  809. X                delim = ';';
  810. X                break;
  811. X    
  812. X            case TERM_VT2:    /* DEC VT220 / 320 */
  813. X            case TERM_VT3:
  814. X            case TERM_PCVT:
  815. X                delim = 'q';
  816. X                break;
  817. X    
  818. X            case TERM_HPX:    /* X11 HEWLETT-PACKARD */
  819. X                delim = '-';
  820. X                break;
  821. X    
  822. X            default:    /* everything else */
  823. X                delim = DEFDELIMCH;
  824. X                break;
  825. X        }
  826. X    }
  827. X    else
  828. X    {
  829. X        delim = DEFDELIMCH;
  830. X    }
  831. X        
  832. X    while(i--)
  833. X        waddch(window, delim);
  834. X
  835. X    if(enter_alt_charset_mode && exit_alt_charset_mode && !opt_delimiter &&
  836. X       *enter_alt_charset_mode && *exit_alt_charset_mode)
  837. X    {
  838. X        wattroff(window, A_ALTCHARSET);
  839. X    }
  840. X}    
  841. X
  842. X/*---------------------------------------------------------------------------*
  843. X *    print error string in header-line
  844. X *---------------------------------------------------------------------------*/
  845. Xvoid error(char *str)
  846. X{
  847. X    extern int errno;
  848. X    extern char *sys_errlist[];
  849. X    extern int sys_nerr;
  850. X
  851. X    int i;
  852. X
  853. X    if(str == NULL)
  854. X    {
  855. X        if(errno && (errno <= sys_nerr))
  856. X            strcpy(errorline, sys_errlist[errno]);
  857. X        else
  858. X            strcpy(errorline, "Unknown Error, call your guru ...");
  859. X    }
  860. X    strcpy(errorline, str);        
  861. X
  862. X    i = strlen(errorline);
  863. X    while(i++ < COLS)
  864. X        strcat(errorline," ");
  865. X
  866. X    wmove(cmnd_w, C_HEAD, 0);
  867. X    wattron(cmnd_w, A_REVERSE);
  868. X    waddstr(cmnd_w, errorline);
  869. X    wattroff(cmnd_w, A_REVERSE);
  870. X    wmove(cmnd_w, C_LINE, curcol());
  871. X    suspend_time();
  872. X    errorflag = 1;
  873. X}
  874. X
  875. X/*---------------------------------------------------------------------------*
  876. X *    clear error string and rewrite "normal" header
  877. X *---------------------------------------------------------------------------*/
  878. Xvoid clrerror(void)
  879. X{
  880. X    if(errorflag)                /* error-string in header ? */
  881. X    {
  882. X        resume_time();
  883. X        errorflag = 0;            /* reset error-flag */        
  884. X        wmove(cmnd_w, C_HEAD, 0);    /* headerline pos */
  885. X        wclrtoeol(cmnd_w);        /* clear old */
  886. X        header();            /* rewrite header */
  887. X        wmove(cmnd_w, C_LINE, curcol());
  888. X    }
  889. X}    
  890. X
  891. X/*---------------------------------------------------------------------------*
  892. X *    fatal, irrecoverable error
  893. X *---------------------------------------------------------------------------*/
  894. Xvoid fatal(char *str)
  895. X{
  896. X    free_list();        /* free memory */
  897. X    fini_flabels();        /* fk-labels to normal */
  898. X    endwin();        /* exit curses */
  899. X    fprintf(stderr,"\n\n\t *** Wish Fatal Error: ***\n\t *** [%s] ***\n\n",str);
  900. X    exit(1);
  901. X}
  902. X
  903. X/*---------------------------------------------------------------------------*
  904. X *    print headerline centered in display
  905. X *---------------------------------------------------------------------------*/
  906. Xvoid header(void)
  907. X{
  908. X    int p,q;
  909. X
  910. X    wmove(cmnd_w, C_HEAD, 0);
  911. X
  912. X    if(errorflag)
  913. X    {
  914. X        wattron(cmnd_w, A_REVERSE);
  915. X        waddstr(cmnd_w, errorline);
  916. X        wattroff(cmnd_w, A_REVERSE);
  917. X    }
  918. X    else
  919. X    {
  920. X        wattron(cmnd_w, A_REVERSE);
  921. X        if((COLS+1) > 80)
  922. X        {
  923. X            p = (COLS+1) - 80;
  924. X            p /= 2;
  925. X            q = p;
  926. X            while(q--)
  927. X                waddch(cmnd_w, SPACE);
  928. X            waddstr(cmnd_w, headerline);
  929. X            q = p;
  930. X            while(q--)
  931. X            waddch(cmnd_w, SPACE);
  932. X        }
  933. X        else
  934. X        {
  935. X            waddstr(cmnd_w, headerline);
  936. X        }
  937. X        wattroff(cmnd_w, A_REVERSE);
  938. X    }
  939. X    sepaline(cmnd_w);
  940. X    wmove(cmnd_w, C_LINE, curcol());
  941. X}
  942. X
  943. X/*---------------------------------------------------------------------------*
  944. X *    display the attribute window, init if required
  945. X *---------------------------------------------------------------------------*/
  946. Xvoid attribs(int flag)
  947. X{
  948. X    if(!opt_attrib)
  949. X        return;
  950. X        
  951. X    if(flag)    /* rewrite static data ?? */
  952. X    {
  953. X        sepaline(attr_w);
  954. X
  955. X        wmove(attr_w, 1, PS_SIZE);
  956. X        wattron(attr_w, A_REVERSE);
  957. X        waddstr(attr_w, ST_SIZE);
  958. X        wattroff(attr_w, A_REVERSE);
  959. X
  960. X        wmove(attr_w, 1, PS_USER);
  961. X        wattron(attr_w, A_REVERSE);
  962. X        waddstr(attr_w, ST_USER);
  963. X        wattroff(attr_w, A_REVERSE);
  964. X        
  965. X        wmove(attr_w, 1, PS_GRUP);
  966. X        wattron(attr_w, A_REVERSE);
  967. X        waddstr(attr_w, ST_GRUP);
  968. X        wattroff(attr_w, A_REVERSE);
  969. X
  970. X        wmove(attr_w, 1, PS_DATE);
  971. X        wattron(attr_w, A_REVERSE);
  972. X        waddstr(attr_w, ST_DATE);
  973. X        wattroff(attr_w, A_REVERSE);
  974. X    }
  975. X    mvwaddstr(attr_w, 1, PP_PERM, cur_file->oprm);              /* permissions */
  976. X    if(cur_file->oislnk)                          /* a link ?? */
  977. X        mvwaddch(attr_w, 1, PP_PERM, 'l');              /*     yes ! */
  978. X    mvwprintw(attr_w, 1, PP_SIZE, "%-9d",cur_file->osiz);          /* filesize */
  979. X    mvwaddstr(attr_w, 1, PP_USER, user_from_uid(cur_file->ousr, 8));  /* user */
  980. X    mvwaddstr(attr_w, 1, PP_GRUP, group_from_gid(cur_file->ogrp, 8)); /* group */
  981. X    mvwaddstr(attr_w, 1, PP_DATE, cur_file->odat);                    /* date */
  982. X}
  983. X
  984. X/*---------------------------------- EOF -------------------------------------*/
  985. END_OF_FILE
  986.   if test 6728 -ne `wc -c <'header.c'`; then
  987.     echo shar: \"'header.c'\" unpacked with wrong size!
  988.   fi
  989.   # end of 'header.c'
  990. fi
  991. if test -f 'wish.1' -a "${1}" != "-c" ; then 
  992.   echo shar: Will not clobber existing file \"'wish.1'\"
  993. else
  994.   echo shar: Extracting \"'wish.1'\" \(22850 characters\)
  995.   sed "s/^X//" >'wish.1' <<'END_OF_FILE'
  996. X.\"---------------------------------------------------------------------------
  997. X.\"
  998. X.\"                  wish - windowing user friendly shell
  999. X.\"                  ------------------------------------
  1000. X.\"
  1001. X.\"               Copyright (c) 1988-1993 Hellmuth Michaelis
  1002. X.\"
  1003. X.\"                  Eggerstedtstr. 28
  1004. X.\"                  22765 Hamburg
  1005. X.\"                  Germany
  1006. X.\"
  1007. X.\"                  Tel:    +49 / 40 / 384298    (private)
  1008. X.\"                  Tel:    +49 / 40 / 55903-170 (at work)
  1009. X.\"                  e-mail: hm@hcshh.hcs.de
  1010. X.\"
  1011. X.\"                          --------oOo--------
  1012. X.\"
  1013. X.\"   This program is free software; you can redistribute it and/or modify
  1014. X.\"   it under the terms of the GNU General Public License as published by
  1015. X.\"   the Free Software Foundation; either version 2 of the License, or
  1016. X.\"   (at your option) any later version.
  1017. X.\"
  1018. X.\"   This program is distributed in the hope that it will be useful,
  1019. X.\"   but WITHOUT ANY WARRANTY; without even the implied warranty of
  1020. X.\"   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1021. X.\"   GNU General Public License for more details.
  1022. X.\"
  1023. X.\"   You should have received a copy of the GNU General Public License
  1024. X.\"   along with this program; if not, write to the Free Software
  1025. X.\"   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1026. X.\"
  1027. X.\"---------------------------------------------------------------------------
  1028. X.\"
  1029. X.\"    last edit-date: [Mon Sep 20 16:18:03 1993]
  1030. X.\"
  1031. X.\"    -hm    initial manual converted from old text pages
  1032. X.\"    -hm    updating to reflect changes, version 1.00
  1033. X.\"
  1034. X.\"---------------------------------------------------------------------------
  1035. X.PU
  1036. X.TH wish 1
  1037. X.SH NAME
  1038. Xwish \- windowing user friendly shell 
  1039. X.SH SYNOPSIS
  1040. X.B wish
  1041. X[
  1042. X.RB [ + | - ]
  1043. X.RB [ acCdflnprw ]
  1044. X]
  1045. X.SH DESCRIPTION
  1046. X.I Wish
  1047. Xis a powerful fullscreen, menu-based, easy to use and user friendly 
  1048. Xinterface to the UNIX (tm) filesystem. It can also be used as a shell
  1049. Xreplacement for interactive use.
  1050. XIt is intended for character terminal environments where such tools are not
  1051. Xavailable at all and where one needs a general purpose tool for easily
  1052. Xwalking through the filesystem.
  1053. X.SH OPTIONS
  1054. X.I Wish
  1055. Xhas several commandline options to change the runtime behaviour:
  1056. X.sp
  1057. X.ta 0.4i
  1058. X.in +0.4i
  1059. X.ti -0.4i
  1060. X\fB+a\fR    Display the "attribute" line at the bottom of the screen.
  1061. XIf you don't like to contiuously have the line showing the current file's
  1062. Xattributes, you can switch this off by using the -a switch. As a side
  1063. Xeffect, you will be able to use two more screen lines for the file window
  1064. Xdisplay. 
  1065. X.sp
  1066. X.ti -0.4i
  1067. X\fB-a\fR    Don't display the "attribute" line.
  1068. X.sp
  1069. X.ti -0.4i
  1070. X\fB+C\fR    On CDROM media, files containing data have often all execute
  1071. Xattributes set, so that
  1072. X.I wish
  1073. Xtries to execute the file as a shell script when selected for display. By 
  1074. Xspecifying the
  1075. X.B +C
  1076. Xoption in conjunction with the
  1077. X.B +c
  1078. Xoption,
  1079. X.I wish
  1080. Xremoves internally all execute permission from ordinary files.
  1081. X.sp
  1082. X.ti -0.4i
  1083. X\fB-C\fR    No execute permission removal is done on regular files.
  1084. X.sp
  1085. X.ti -0.4i
  1086. X\fB+c\fR    On CDROM's conforming to the
  1087. X.I High Sierra
  1088. Xor the
  1089. X.I ISO-9660
  1090. Xstandard a version number is appended to a regular file's name delimited
  1091. Xby a semicolon. This semicolon is interpreted by the shell as an end of
  1092. Xline delimiter. To get around this behaviour,
  1093. X.I wish
  1094. Xescapes the semicolon by placing a backslash in front of the semicolon
  1095. Xif this option is selected.
  1096. X.sp
  1097. X.ti -0.4i
  1098. X\fB-c\fR    Do not escape the semicolon in CDROM filenames.
  1099. X.sp
  1100. X.ti -0.4i
  1101. X\fB+d\fR    Try to preserve the current directory when walking through
  1102. Xthe directory tree.
  1103. X.sp
  1104. X.ti -0.4i
  1105. X\fB-d\fR    Don't try to preserve the current directory.
  1106. X.sp
  1107. X.ti -0.4i
  1108. X\fB+f\fR    Display "virtual" function key labels.
  1109. X.I Wish
  1110. Xdetects the presence of a Hewlett-Packard-Terminal by the presence 
  1111. Xof the "xs"-flag in termcap or the "xhp"-flag in terminfo. If this flag is
  1112. Xnot present, 
  1113. X.I wish
  1114. Xemulates the function key labels in the last line of the
  1115. Xscreen. If this behaviour is not desired, use the -f switch to run
  1116. X.I wish
  1117. Xwithout emulated function key labels. 
  1118. X.sp
  1119. X.ti -0.4i
  1120. X\fB-f\fR    Don't Display "virtual" function key labels.
  1121. X.sp
  1122. X.ti -0.4i
  1123. X\fB+l\fR    Enable the detection and display of symbolic links. This option
  1124. Xonly makes sense if the "attributes" line is displayed.
  1125. X.sp
  1126. X.ti -0.4i
  1127. X\fB-l\fR    Disable the detection and display of symbolic links. 
  1128. X.sp
  1129. X.ti -0.4i
  1130. X\fB+n\fR    Enable display of filenames starting with a dot.
  1131. X.sp
  1132. X.ti -0.4i
  1133. X\fB-n\fR    Disable display of filenames starting with a dot.
  1134. X.sp
  1135. X.ti -0.4i
  1136. X\fB+p\fR    Display the current directory as "." in the file window
  1137. Xof the screen. Usually the first file displayed in the file window is the 
  1138. X"..", the directory above the current directory. This is convenient for 
  1139. Xeasy walking through the directory tree. Although the current directory,
  1140. X".", is not displayed, it is present and included in the entry count in
  1141. Xthe upper right corner of the file window. If you wish to display the
  1142. Xcurrent directory too, use the +p switch to turn this option on. 
  1143. X.sp
  1144. X.ti -0.4i
  1145. X\fB-p\fR    Don't display the current directory as ".".
  1146. X.sp
  1147. X.ti -0.4i
  1148. X\fB+r\fR    Wait for pressing \fIRETURN\fR after executing an external
  1149. Xcommand.
  1150. X.sp
  1151. X.ti -0.4i
  1152. X\fB-r\fR    Don't wait for pressing \fIRETURN\fR after executing an external
  1153. Xcommand.
  1154. X.sp
  1155. X.ti -0.4i
  1156. X\fB+w\fR    Enable the processing of wildcard filenames for file display.
  1157. XThe wildcard specification must be entered using the
  1158. X.B \.wishrc
  1159. Xfile option "wildcard=" or by using
  1160. X.I wish's
  1161. Xconfiguration screen.
  1162. X.sp
  1163. X.ti -0.4i
  1164. X\fB-w\fR    Disable the processing of wildcard filenames.
  1165. X.sp
  1166. X.ti -0.4i
  1167. X\fB-?\fR    Displays current version of 
  1168. X.I wish
  1169. Xand copyright and usage
  1170. Xinformation.
  1171. X.SH THE DISPLAY SCREEN
  1172. XAfter starting 
  1173. X.I wish
  1174. X, the screen becomes divided into several "windows":
  1175. X.SS Command Window
  1176. XThe command window consists of the uppermost two lines on screen, the first
  1177. Xline is displaying the program's name, version, copyright information,
  1178. Xterminal type and the current time. In case that an error message has to be
  1179. Xdisplayed, this line is used to display the error message until the next key
  1180. Xis pressed.
  1181. X.PP
  1182. XThe next line in this window is the the \fIcommand line\fR, displaying the
  1183. Xcurrent history line number as it's prompt. One can cycle through the command
  1184. Xline history by using the popular emacs control sequences. Any alphanumeric
  1185. Xinput typed at the keyboard is displayed here and executed by the users
  1186. Xshell (system(3)) after pressing <return>.
  1187. X.SS File Window
  1188. XThe middle part of the screen becomes your "window" into the
  1189. Xcurrently selected directory - it's called the file window. The
  1190. Xfirst line of the file window contains the full pathname of the current
  1191. Xdirectory together with the number of files in this directory labelled
  1192. X.B Entries.
  1193. XIf filename wildcarding is active, this label becomes
  1194. X.B Matches.
  1195. X.sp
  1196. XWith the cursor keys, the user moves a "cursor" or "current file", which is a
  1197. Xhighlighted bar, over the filenames in the file window. If a file
  1198. Xis made the current selected file by placing the cursor on it,
  1199. Xvarious operations can be done on it, i.e. if the file is a
  1200. Xdirectory, and the user hits return, a change to that directory is
  1201. Xdone. If the file is an executable file, it is either executed as a
  1202. Xbinary executable or as a shell script. If the file is a data file
  1203. Xit is displayed by the selected pager program - more options are
  1204. Xavailable. If there are more files in a directory than fitting into 
  1205. Xthe file window, it can be paged through by using the page up/down
  1206. Xfunction keys.
  1207. X.sp
  1208. XFiles can be marked in the file window and expanded in the
  1209. Xcommandline by the special wildcard character "%" - so if you mark
  1210. Xseveral files in the file window, and type "rm % <RETURN>" in the
  1211. Xcommandline, all selected files will be deleted. 
  1212. X.sp
  1213. XThe current selected filename can be echoed onto the commandline
  1214. Xfor further processing by some other commands. 
  1215. X.sp
  1216. XIf there are more files in the directory than will fit into the file window,
  1217. Xone can move through file window "pages" by using the PAGE UP and PAGE DOWN
  1218. Xterminal keys. There is an indicator available in the lower right corner
  1219. Xof the file window for telling the user if there is page above "^", a page
  1220. Xbelow "V" or pages above and below "*" available beside the current one.
  1221. X.sp
  1222. X.SS Attribute Window
  1223. XIf it was configured by either using the commandline switch 
  1224. X.B a
  1225. Xor by using the configuration file option, the lower part of the screen
  1226. Xbecomes the attribute window. Here are the attributes of the currently
  1227. Xhighlighted file displayed: permissions, size, user, group and date.
  1228. X.SS Function Key Label Window
  1229. XIf it was configured by either using the commandline switch 
  1230. X.B f
  1231. Xor by using the configuration file option, the last part of the screen
  1232. Xbecomes the virtual function key label window.
  1233. XSome 
  1234. X.I wish
  1235. Xfunctionality is controllable by the terminals special
  1236. Xfunction keys (f1....f8). Hewlett-Packard Terminals have special
  1237. Xprogrammable function key labels; for terminals having
  1238. Xfunction keys, but no labels, 
  1239. X.I wish
  1240. Xsimulates 8 function key labels in the last line of the terminal.
  1241. X.PP
  1242. X.SH Command Window Keys
  1243. X.sp
  1244. X.ta 0.4i
  1245. X.in +0.4i
  1246. X.ti -0.4i
  1247. X\fBBackspace\fR - Erases the character left of the cursor.
  1248. X.sp
  1249. X.ti -0.4i
  1250. X\fBDelete\fR - Erases the character under the cursor.
  1251. X.sp
  1252. X.ti -0.4i
  1253. X\fBReturn\fR - Return key handling is dependent of the status of
  1254. Xthe commandline:
  1255. X.br
  1256. X.B Commandline contains characters:
  1257. X.br
  1258. XThe command string entered into the command line is terminated and executed
  1259. Xby handing it to the system() call to execute it.
  1260. X.br
  1261. X.B Commandline is empty:
  1262. X.br
  1263. XWhile you are maneuvering with the highlighting bar through the file
  1264. Xwindow, you are able to do the most natural commands depending on the
  1265. Xtype of file to the current selected (highlighted) file by just
  1266. Xpressing <RETURN>. This means, that if your file is:
  1267. X.br
  1268. X\(bu a executable program, it is executed 
  1269. X.br
  1270. X\(bu a data file, it is displayed using the pager program
  1271. X.br
  1272. X\(bu a directory, the current directory is changed to the highlighted one
  1273. X.sp
  1274. X.ti -0.4i
  1275. X\fBDelete Char\fR - Erases the character under the cursor.
  1276. X.sp
  1277. X.ti -0.4i
  1278. X\fBControl-F\fR - Forward one character on the commandline.
  1279. X.sp
  1280. X.ti -0.4i
  1281. X\fBControl-B\fR - Backward one character on the commandline.
  1282. X.sp
  1283. X.ti -0.4i
  1284. X\fBControl-P\fR - Previous commandline from history buffer.
  1285. X.sp
  1286. X.ti -0.4i
  1287. X\fBControl-N\fR - Next commandline from history buffer.
  1288. X.sp
  1289. X.ti -0.4i
  1290. X\fBControl-D\fR - If the commandline is empty, exit 
  1291. X.I wish.
  1292. XIf the commandline is not empty, delete the character under the cursor.
  1293. X.sp
  1294. X.ti -0.4i
  1295. X\fBControl-K\fR - Kill the line on the commandline from the cursor
  1296. Xposition to the end of the commandline and place the string into the
  1297. Xkill-buffer. See also key 
  1298. X.B
  1299. XControl-Y.
  1300. X.sp
  1301. X.ti -0.4i
  1302. X\fBControl-Y\fR - Yank text from the kill-buffer (if any) onto the
  1303. Xcommandline at the current cursor position. See also key
  1304. X.B
  1305. XControl-K.
  1306. X.sp
  1307. X.ti -0.4i
  1308. X\fBControl-A\fR - Position the cursor at the beginning of the
  1309. Xcommandline.
  1310. X.sp
  1311. X.ti -0.4i
  1312. X\fBControl-E\fR - Position the cursor at the endo of the commandline.
  1313. X.sp
  1314. X.ti -0.4i
  1315. X\fBControl-L\fR - Refresh display
  1316. X.sp
  1317. X.ti -0.4i
  1318. X\fBAlphanumeric Characters\fR     Any alphanumeric, non-control character
  1319. Xtyped on the keyboard is displayed on the commandline.
  1320. X.PP
  1321. X.SH File Window Keys
  1322. X.sp
  1323. X.ta 0.4i
  1324. X.in +0.4i
  1325. X.ti -0.4i
  1326. X\fBCursor Right\fR - Move the current file one position
  1327. Xto the right. If on the right margin, wrap onto the next line, first position.
  1328. XIf on the lowest right position, wrap to the upper left position.
  1329. X.sp
  1330. X.ti -0.4i
  1331. X\fBCursor Left\fR - Move the current file one position
  1332. Xto the left. If on the left margin, wrap onto the previous line, last position.
  1333. XIf on the upper left position, wrap to the lowest right position.
  1334. X.sp
  1335. X.ti -0.4i
  1336. X\fBCursor Up\fR - Move the current file one position up in the same column.
  1337. X.sp
  1338. X.ti -0.4i
  1339. X\fBCursor Down\fR - Move the current file one position down in the same column.
  1340. X.sp
  1341. X.ti -0.4i
  1342. X\fBCursor Home\fR - Move the current file to the upper left position.
  1343. X.sp
  1344. X.ti -0.4i
  1345. X\fBCursor Home Down\fR - Move the current file to the lower right position.
  1346. X.sp
  1347. X.ti -0.4i
  1348. X\fBNext Page\fR - Display the next file window screen (if any).
  1349. X.sp
  1350. X.ti -0.4i
  1351. X\fBPrevious Page\fR - Display the previous file window screen (if any).
  1352. X.PP
  1353. X.SH Function Keys
  1354. X.sp
  1355. X.ta 0.4i
  1356. X.in +0.4i
  1357. X.ti -0.4i
  1358. X\fBFunction Key 1\fR - Edit the current file with your editor.
  1359. XThis function is also executable by pressing "ESC 1".
  1360. X.sp
  1361. X.ti -0.4i
  1362. X\fBFunction Key 2\fR - Echo the current filename onto the commandline.
  1363. XThis function is also executable by pressing "ESC 2".
  1364. X.sp
  1365. X.ti -0.4i
  1366. X\fBFunction Key 3\fR - Display the help screen.
  1367. XThis function is also executable by pressing "ESC 3".
  1368. X.sp
  1369. X.ti -0.4i
  1370. X\fBFunction Key 4\fR - Enter the
  1371. X.I wish
  1372. Xruntime configuration menu screen.
  1373. XThis function is also executable by pressing "ESC 4".
  1374. X.sp
  1375. X.ti -0.4i
  1376. X\fBFunction Key 5\fR - Mark the current filename. The current filename advances
  1377. Xone position to the right. [KEY_F(5)]
  1378. XThis function is also executable by pressing "ESC 5".
  1379. X.sp
  1380. X.ti -0.4i
  1381. X\fBFunction Key 6\fR - Unmark all marked filenames.
  1382. XThis function is also executable by pressing "ESC 6".
  1383. X.sp
  1384. X.ti -0.4i
  1385. X\fBFunction Key 7\fR - No function.
  1386. XThis function is also executable by pressing "ESC 7".
  1387. X.sp
  1388. X.ti -0.4i
  1389. X\fBFunction Key 8\fR - Close the current directory and open the the next
  1390. Xupper directory (this has the same effect as executing "cd .." on the commandline.
  1391. XThis function is also executable by pressing "ESC 8".
  1392. X.sp
  1393. X.PP
  1394. X.SH HANDLING OF FILES WITH SPECIAL ENDINGS
  1395. XSeveral endings of filenames are detected and handled according to
  1396. Xbuilt-in rules, these are:
  1397. X.in +0.4i
  1398. X.ti -0.4i
  1399. X.RS
  1400. X.TP 15
  1401. X file-ending
  1402. X method to handle file
  1403. X.PD 0
  1404. X.TP
  1405. X -----------
  1406. X ---------------------
  1407. X.TP
  1408. X .tar.Z
  1409. X | compress -dfc | tar tvf -
  1410. X.TP
  1411. X .tar.z
  1412. X | gzip -cdf | tar tvf -
  1413. X.TP
  1414. X .tar.gz
  1415. X | gzip -cdf | tar tvf -
  1416. X.TP
  1417. X .Z
  1418. X | compress -dfc
  1419. X.TP
  1420. X .z
  1421. X | gzip -cdf
  1422. X.TP
  1423. X .gz
  1424. X | gzip -cdf
  1425. X.RE
  1426. X.PD
  1427. X.sp
  1428. X.PP
  1429. X.SH MARKING FILES
  1430. XA special purpose wildcard character is recognized on the command line and
  1431. Xis expanded after pressing <RETURN>, it is the character "%" (percent).
  1432. XThis character expands to all marked files in the file window and gives the user
  1433. Xa new powerful file handling functionality.
  1434. XSee also the 
  1435. X.B
  1436. XFunction Key 5
  1437. Xand
  1438. X.B
  1439. XFunction Key 6
  1440. Xfunctions.
  1441. X.sp
  1442. X.PP
  1443. X.SH FILENAME COMPLETITION
  1444. XThere is a rather primitive filename completition available on the commandline,
  1445. Xwhich is initiated by pressing the Escape key twice.
  1446. X.sp
  1447. X.PP
  1448. X.SH COMMANDLINE WILDCARD PROCESSING
  1449. XIt is possible to specify wildcard characters in a filename on the commandline.
  1450. XIf the command to be performed is not a
  1451. X.B cd
  1452. Xcommand, the wildcard matching rules of the shell used apply, if the command
  1453. Xis a 
  1454. X.B cd
  1455. Xcommand (which is executed by 
  1456. X.I wish
  1457. Xitself), the wildcard string is interpreted according to the following rules:
  1458. X.TP
  1459. X.BI \e x
  1460. XTurns off the special meaning of
  1461. X.I x
  1462. Xand matches it directly; this is used mostly before a question mark or
  1463. Xasterisk, and is not valid inside square brackets.
  1464. X.TP
  1465. X.B ~
  1466. XAt the beginning of a pathname is replaced with the users's HOME directory
  1467. X.TP
  1468. X.B ?
  1469. XMatches any single character.
  1470. X.TP
  1471. X.B *
  1472. XMatches any sequence of zero or more characters.
  1473. X.TP
  1474. X.BI [ x...y ]
  1475. XMatches any single character specified by the set
  1476. X.IR x...y ,
  1477. Xwhere any character other than minus sign or close bracket may appear
  1478. Xin the set.
  1479. XA minus sign may be used to indicate a range of characters.
  1480. XThat is,
  1481. X.I [0\-5abc]
  1482. Xis a shorthand for
  1483. X.IR [012345abc] .
  1484. XMore than one range may appear inside a character set;
  1485. X.I [0-9a-zA-Z._]
  1486. Xmatches almost all of the legal characters for a host name.
  1487. X.TP
  1488. X.BI [!x...y ]
  1489. XThis matches any character
  1490. X.I not
  1491. Xin the set
  1492. X.IR x...y ,
  1493. Xwhich is interpreted as described above.
  1494. X.br
  1495. XThere is no way to specify a minus sign in a character range.
  1496. X.sp
  1497. X.PP
  1498. X.SH FILE WINDOW WILDCARD PROCESSING
  1499. XIf the users wants to display just some files in the file window, he may do
  1500. Xso by specifying a wildcard string in the configuration menu or with the 
  1501. Xconfiguration file variable
  1502. X.B wildcard.
  1503. XThe rules for constructing such a string are the same as described in the above
  1504. Xparagraph.
  1505. XBecause there is a speed penalty in using this option, it has to be enabled
  1506. Xin the configuartion menu or file.
  1507. X.sp
  1508. XIf wildcard processing is in effect, the label
  1509. X.B Entries
  1510. Xin the upper right corner of the file window is replaced by the label
  1511. X.B Matches.
  1512. X.sp
  1513. XFilename wildcard processing affect all types of files with the exception
  1514. Xof directories, which are always displayed.
  1515. X.sp
  1516. X.PP
  1517. X.SH THE ATTRIBUTE WINDOW
  1518. XIf an attribute window is displayed, (see command line options
  1519. X.B
  1520. X+a
  1521. Xand
  1522. X.B
  1523. X-a
  1524. X), some more information for the currently highlighted file in the file
  1525. Xwindow is displayed:
  1526. X.br
  1527. X\(bu the file access permissions in a format as used by the "ls" utility
  1528. X.br
  1529. X\(bu the file size in bytes
  1530. X.br
  1531. X\(bu the name of the owner of the file
  1532. X.br
  1533. X\(bu the name of the group of the file
  1534. X.br
  1535. X\(bu the file access time
  1536. X.PP
  1537. X.SH CONFIGURATION FILE
  1538. XOn startup, 
  1539. X.I wish
  1540. Xsearches a startup configuration file named ".wishrc" in the
  1541. Xusers HOME directory, and, if found, configures itself using the information
  1542. Xin this file.
  1543. X.br
  1544. XOne can configure 
  1545. X.I wish
  1546. Xby setting three types of Variables:
  1547. X.br
  1548. X.sp
  1549. X.SS Boolean Variables
  1550. X.sp
  1551. XBoolean Variables can be set/reset by using the stings "on" or "off"
  1552. Xafter the variable name and an equal sign.
  1553. X.ta 0.4i
  1554. X.in +0.4i
  1555. X.ti -0.4i
  1556. X\fBattributes\fR - Enable/disable attribute line display
  1557. X.sp
  1558. X.ti -0.4i
  1559. X\fBpreserve\fR - Enable/disable preserve directory
  1560. X.sp
  1561. X.ti -0.4i
  1562. X\fBfkeys\fR - Enable/disable virtual function key label display
  1563. X.sp
  1564. X.ti -0.4i
  1565. X\fBlinks\fR - Enable/disable link detection and display
  1566. X.sp
  1567. X.ti -0.4i
  1568. X\fBpoint\fR - Enable/disable display of the current directory in the file 
  1569. Xwindow as "." (dot).
  1570. X.sp
  1571. X.ti -0.4i
  1572. X\fBreturn\fR - Enable/disable wait for pressing <RETURN> after a external
  1573. Xcommand is executed.
  1574. X.sp
  1575. X.ti -0.4i
  1576. X\fBwildenable\fR - Enable/disable wildcard filename processing.
  1577. X.sp
  1578. X.ti -0.4i
  1579. X\fBcdrom\fR - Enable/disable CDROM semicolon in filename processing.
  1580. X.sp
  1581. X.ti -0.4i
  1582. X\fBcdnoprog\fR - Enable/disable CDROM removal of execute permissions.
  1583. X.sp
  1584. X.ti -0.4i
  1585. X\fBdotnames\fR - Enable/disable the display of filenames starting with a dot.
  1586. X.br
  1587. X.sp
  1588. X.SS String Variables
  1589. X.sp
  1590. X.ta 0.4i
  1591. X.in +0.4i
  1592. X.ti -0.4i
  1593. X\fBpager\fR - the partial or full filename of the program to be used as 
  1594. Xthe pager program.
  1595. X.sp
  1596. X.ti -0.4i
  1597. X\fBeditor\fR - the partial or full filename of the program to be used as 
  1598. Xthe editor program.
  1599. X.sp
  1600. X.ti -0.4i
  1601. X\fBwildcard\fR - specify a wildcard expression to be used for selecting
  1602. Xfilenames to be displayed in the file window.
  1603. X.br
  1604. X.sp
  1605. X.SS Character Variables
  1606. X.sp
  1607. X.ta 0.4i
  1608. X.in +0.4i
  1609. X.ti -0.4i
  1610. X\fBdelimiter\fR - the delimiter character to be used to delimit the command
  1611. Xand the the attribute window from the file window.
  1612. X.sp
  1613. X.SH STARTUP AND CONFIGURATION-FILE PROCESSING
  1614. XWhen 
  1615. X.I wish
  1616. Xis started, it runtime configures itself in the following
  1617. Xorder:
  1618. X.br
  1619. X.IP 1.
  1620. Xit sets up defaults taken from the environment
  1621. X.IP 2.
  1622. Xit (re-) configures itself by reading the 
  1623. X.B .wishrc 
  1624. Xconfiguration file from the users HOME directory
  1625. X.IP 3.
  1626. Xthe command line options (if any) are processed and used for (re-)configuration
  1627. X.sp
  1628. X.SH RUNTIME CONFIGURATION
  1629. XWhile running
  1630. X.I wish
  1631. Xthe user is able to change several configuration variables on the fly by
  1632. Xusing the configuration menu which is entered by pressing
  1633. X.B Function Key 4.
  1634. X.sp
  1635. XYou can leave the configuration menu by pressing 
  1636. X.B CONTROL-D.
  1637. X.sp
  1638. XPressing
  1639. X.B SPACE
  1640. Xtoggles a the value of a boolean variable.
  1641. X.sp
  1642. XA wildcard string can be entered by moving the curser onto the 
  1643. X.B Wildcard
  1644. Xfield and pressing <RETURN>, the only editing key available is <BACKSPACE>.
  1645. XLeave the field by pressing <RETURN> again - remember to enable the processing
  1646. Xof wildcards by setting the boolean variable
  1647. X.B WildEnabl
  1648. Xto YES.
  1649. X.sp
  1650. XThe variables in the lower half of the screen are just displayed but cannot
  1651. Xbe changed here. Use the 
  1652. X.B .wishrc
  1653. Xconfiguration file options to change these and restart
  1654. X.I wish.
  1655. X.sp
  1656. X.PP
  1657. X.SH ENVIRONMENT
  1658. X.I Wish
  1659. Xdepends on some of the following environment variables:
  1660. X.sp
  1661. X.ta 0.4i
  1662. X.in +0.4i
  1663. X.ti -0.4i
  1664. X\fBHOME\fR - mandatory, the users HOME directory
  1665. X.sp
  1666. X.ti -0.4i
  1667. X\fBPAGER\fR - optional, the pager program used to display text files, this
  1668. Xdefaults to using "more".
  1669. X.sp
  1670. X.ti -0.4i
  1671. X\fBEDITOR\fR - optional, the ditor used for editing files, if this variable
  1672. Xdoes not exist, the environment variable \fBVISUAL\fR is used, if it also
  1673. Xdoes not exist, this defaults to "vi".
  1674. X.sp
  1675. X.ti -0.4i
  1676. X\fBTERM\fR - mandatory, the users termcap/terminfo entry
  1677. X.sp
  1678. X.PP
  1679. X.SH SEE ALSO
  1680. Xsh(1), system(3)
  1681. X.SH COPYRIGHT
  1682. X.I Wish
  1683. Xis
  1684. X.br
  1685. XCopyright (c) 1988-1993 by Hellmuth Michaelis
  1686. X.br
  1687. XEggerstedtstr. 28
  1688. X.br
  1689. X22765 Hamburg
  1690. X.br
  1691. XGermany
  1692. X.br
  1693. XTel: +49 40 384298 (private)
  1694. X.br
  1695. XTel: +49 40 55903-170 (at work)
  1696. X.br
  1697. Xe-mail: hm@hcshh.hcs.de
  1698. X.sp
  1699. XAll rights are reserved except as explicitly granted
  1700. Xby written permission of the author.
  1701. X.sp
  1702. X.I
  1703. XWish
  1704. Xis free software; you can redistribute it and/or modify it under the
  1705. Xterms of the GNU General Public License as published by
  1706. Xthe Free Software Foundation; either version 2 of the License, or
  1707. X(at your option) any later version.
  1708. X.sp
  1709. XSee the file COPYING, distributed with 
  1710. X.I wish
  1711. X, for restriction
  1712. Xand warranty information
  1713. X.sp
  1714. XThe 
  1715. X.B wildmat(3)
  1716. Xlibrary function used by
  1717. X.I wish
  1718. Xto perform all types of wildcard matching was written by Rich $alz 
  1719. X<rsalz@bbn.com> in 1986, and posted to Usenet. The version used here
  1720. Xwas taken from volume 17 of comp.sources.misc.
  1721. X.SH RETURN VALUES
  1722. XThe return value is 0 if 
  1723. X.I wish
  1724. Xwas exited normally by the user, any other
  1725. Xreturn value signals that a fatal error has occured.
  1726. X.SH FILES
  1727. X$HOME/.wishrc
  1728. X.SH DIAGNOSTICS
  1729. X.I Wish
  1730. Xuses the first line (which under no error conditions contains a copyright
  1731. Xmessage, version, terminal name and time) to tell the user in case of error
  1732. Xwhat type of error has occured. This error message is overwritten with the
  1733. Xnormal header when the next key is pressed.
  1734. X.SH HISTORY
  1735. X.I Wish
  1736. Xwas modeled after a utility called "PAM" (Personal Application Manager)
  1737. Xwhich was distributed as part of the Hewlett-Packards HP-UX (tm)
  1738. XOperating System.
  1739. X.sp
  1740. XIn contrast to PAM, which runs only on HP's own terminals,
  1741. X.I wish
  1742. Xis curses based
  1743. Xand should run on all sorts of terminals, although it was tested just with
  1744. XHP-terminals (HP2392A,HP700/9x) and DEC-terminals (VT100/VT220) and terminal
  1745. Xemulators which come with X Windows (xterm, hpterm).
  1746. X.sp
  1747. X.I Wish
  1748. Xbegan as a termcap based program on a Microware OS-9/68k\*(Tm machine,
  1749. Xmoved over to the HP-UX environment to replace PAM (still termcap based) and
  1750. Xwas then rewritten to use curses.
  1751. X.sp
  1752. XIt is known to compile on OS-9 (using Reimer Mellin's curses library), on
  1753. XHP-UX 7.0, 8.0 and 9.0 using either HP's ANSI-C compiler or GCC from the FSF,
  1754. Xon SUN Sparc's running SunOS 4.1 with the System V curses library, and on 
  1755. X386BSD and NetBSD using a SYSV - compatible curses library originally written
  1756. Xby Pavel Curtis and enhanced and modified by Zeyd Ben-Halim.
  1757. END_OF_FILE
  1758.   if test 22850 -ne `wc -c <'wish.1'`; then
  1759.     echo shar: \"'wish.1'\" unpacked with wrong size!
  1760.   fi
  1761.   # end of 'wish.1'
  1762. fi
  1763. echo shar: End of archive 1 \(of 4\).
  1764. cp /dev/null ark1isdone
  1765. MISSING=""
  1766. for I in 1 2 3 4 ; do
  1767.     if test ! -f ark${I}isdone ; then
  1768.     MISSING="${MISSING} ${I}"
  1769.     fi
  1770. done
  1771. if test "${MISSING}" = "" ; then
  1772.     echo You have unpacked all 4 archives.
  1773.     rm -f ark[1-9]isdone
  1774. else
  1775.     echo You still must unpack the following archives:
  1776.     echo "        " ${MISSING}
  1777. fi
  1778. exit 0
  1779. exit 0 # Just in case...
  1780.