Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!rutgers!mit-eddie!genrad!decvax!decwrl!cookie.dec.com!wecker From: wecker@cookie.dec.com (DAVE TANSTAAFL WECKER) Newsgroups: comp.sys.amiga Subject: Patch for Matts SHELL Message-ID: <6801@decwrl.DEC.COM> Date: Sun, 7-Dec-86 22:35:24 EST Article-I.D.: decwrl.6801 Posted: Sun Dec 7 22:35:24 1986 Date-Received: Mon, 8-Dec-86 02:08:39 EST Sender: daemon@decwrl.DEC.COM Organization: Digital Equipment Corporation Lines: 47 I found a need to invoke Matt's shell to execute a single command line and then exit (I also found some REAL bizarreness in AmigaDOS (posted in a separate note)) so that I could use his shell from MAKE files. For example, I want to be able to access all of the SHELL built-in commands without having to keep copies in c: (like copy, delete, rename ....). Here is a fragment from one of my MAKE files: foo : $(OBJS) shell -c copy df0:lib/c.lib ram: ln -v -o foo foo.o -lc shell -c ram:c.lib The new 'feature' is the addition of the '-c' switch with says take all remaining arguments as a command line, execute it, and exit. You can even invoke scripts before the -c: shell .login -c echo test1 ; date ; echo test2 The patch was so easy, I figured it would be useful to post it directly. Change the first 'for' loop in main.c (that scans for command line source files) to be: ==============================altered code============================== for (i = 1; i < argc; ++i) { if (argv[i][0] == '-' && argv[i][1] == 'c') { Inline[0] = ' '; Inline[1] = '\000'; while (++i < argc) { strcat(Inline,argv[i]); strcat(Inline," "); } exec_command(Inline); main_exit(0); } strcpy (Inline, "source "); strcat (Inline, argv[i]); av[1] = argv[i]; do_source (Inline); } ========================================================================= That's it... I've been using it all day and it seems to work like a charm. dave {decwrl|decvax|decuac}!cookie.dec.com!wecker (Arpa: wecker%cookie.dec.com@decwrl.dec.com)