home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / cwish / part01 < prev    next >
Encoding:
Text File  |  1993-11-01  |  59.6 KB  |  1,788 lines

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