[comp.sys.amiga.tech] Shells

rlcarr@athena.mit.edu (Richard L. Carreiro) (12/08/90)

Are there any shells for the amiga (either commercial or freely redist.)
that actually do the wildcard expansion, rather than the program
having to do it?  In other words, if I have a directory containing:
foo.1 foo.2 foo.txt

and I have written a SAS/C program which simply scans argc and argv
and prints out all its command line arguments (call it arg, say) and
I do:
> arg foo.? *.txt 
in that shell, then
foo.1 foo.2 foo.txt

will be the output of my program.

Are there any such beasties?


--
Rich Carreiro                                    The "War on Drugs"
ARPA: rlcarr@athena.mit.edu                      is merely a smokescreen for
UUCP: ...!mit-eddie!mit-athena!rlcarr            The War on the Constitution
BITNET: rlcarr@athena.mit.edu      JITTLOV FOREVER!

david@starsoft.UUCP (Dave Lowrey) (12/09/90)

In article <1990Dec8.082553.8591@athena.mit.edu>, Richard L. Carreiro writes:

>
> Are there any shells for the amiga (either commercial or freely redist.)
> that actually do the wildcard expansion, rather than the program
> having to do it?  In other words, if I have a directory containing:
> foo.1 foo.2 foo.txt
>
> and I have written a SAS/C program which simply scans argc and argv
> and prints out all its command line arguments (call it arg, say) and
> I do:
> > arg foo.? *.txt
> in that shell, then
> foo.1 foo.2 foo.txt
>
> will be the output of my program.
>
> Are there any such beasties?
>
>

Yes, SKsh (avaliable on Fish disks, V1.6 is the latest) does this. It is
a UNIX Korn Shell clone.

There is one limitations however....when passing parameters to commands,
AmigaDos (1.3 and below) limits you to 256 characters on the "command line".

When executing SKsh's built in commands, that is not a limitation.

Check it out, it works great!!!


----------------------------------------------------------------------------
These words be mine. The company doesn't care, because I am the company! :-)

      Dave Lowrey        |  david@starsoft or {uhnix1,lobster}!starsoft!david
Starbound Software Group |
      Houston, TX        | "Dare to be stupid!" -- Weird Al Yankovic

lrg7030@uxa.cso.uiuc.edu (Loren Rittle) (12/09/90)

>Are there any shells for the amiga (either commercial or freely redist.)
>that actually do the wildcard expansion, rather than the program        
>having to do it?  In other words, if I have a directory containing:     
>foo.1 foo.2 foo.txt

Well, I use the WShell v1.2 with an ARexx program to do what you
are asking about and more. See the header below:

/*                                                               
 *  !.rexx ... processes '?', '[]', '*', '.', '..', '~' and '/'  
 *  and `backtick` evaluation                                    
 *  Does filename globbing and minimal UNIX file system emulation
 *  Started: 9/4/89                                              
 *  Updates: 10/22/89 1/9/90                                     
 *  Last update: Tue Feb 20 00:51:27 1990                        
 *  By Loren J. Rittle                                           
 */

This ARexx program is inserted into the WShell prompt so that my
program gets to read in a command line and process it before passing
it on to the WShell.  I better explain what I mean by `inserted into
the WShell prompt,' Bill Hawes, the creator of ConMan, WShell and ARexx,
was thinking ahead (and still is according to some tidbits I heard on
BIX recently...) when he designed the WShell.  He (at least the last
time I spoke with him) is opposed to doing filename expansion in the
shell at least for AmigaOS, but he provides a hook to allow a user
written program to preform any type of preprocessing to a command line
that is typed from a prompt.  Actually the hook was designed to allow
one to run a program to update a titlebar message, check for mail, etc
and it just so happens to have been designed in such a way as to allow
for my use also :-).

!.rexx requires ARexx v1.1, WShell v1.2, ConMan v1.3c, rexxarplib
and ARP (hehehe).  It only runs at an acceptable speed on
an accelerated machine.  In about 2 weeks it will have CSH type
history, because I just got the inspiration to add it after
using UNIX machines for the last semester in a VLSI class.
The WShell via ConMan already support a very nice history 
mechanism, but every once and a while I think about how nice
the CSH type history is.
You (or anyone) can get it from me once I clean it up a bit and
add some documentation.  !.rexx also *needs* to support a better
quoting mechanism as right now there are some things that can't
be passed through...
As you can see, there are some problems, but it has been working
nicely (i.e. providing everything mentioned in the header above)
for myself and about four friends.

Loren J. Rittle
--
``In short, this is the absolute coolest computer device ever invented!''
                   -Tom Denbo speaking about The VideoToaster by NewTek
``Think about NewTek's VideoToaster!  Now think about the Amiga!''
Loren J. Rittle lrg7030@uxa.cso.uiuc.edu

lrg7030@uxa.cso.uiuc.edu (Loren Rittle) (12/09/90)

>There is one limitations however....when passing parameters to commands,    
>AmigaDos (1.3 and below) limits you to 256 characters on the "command line".

WShell v1.2 gets around this limitation of the CLI, not AmigaOS (1.3 and
below).
--
``In short, this is the absolute coolest computer device ever invented!''
                   -Tom Denbo speaking about The VideoToaster by NewTek
``Think about NewTek's VideoToaster!  Now think about the Amiga!''
Loren J. Rittle lrg7030@uxa.cso.uiuc.edu