[comp.sys.amiga] Wildcard expansion

kurt@tc.fluke.COM (Kurt Guntheroth) (12/08/86)

I am not so convinced that automatic wildcard expansion (which UNIX people
apparently call file globbing) in the shell is A Good Thing.  Anyone remenber
commands like

PIP foo.* = bar.*

which would copy bar.c to foo.c, bar.rel to foo.rel, bar.exe to foo.exe?
You just can't do that on UNIX.  Also you sometimes find file globbing to be
a surprise when you are composing a string to grep or sed.  If there is a
convenient globbing function in the library, per-command file globbing
doesn't have to be such a hassle.  Really per-command file globbing is more
flexible.  Oh, well...

hutch@sdcsvax.UUCP (12/10/86)

In article <143@dragon.tc.fluke.COM> kurt@tc.fluke.COM (Kurt Guntheroth) writes:
>I am not so convinced that automatic wildcard expansion (which UNIX people
>apparently call file globbing) in the shell is A Good Thing.  Anyone remenber
>commands like
>
>PIP foo.* = bar.*
>
>which would copy bar.c to foo.c, bar.rel to foo.rel, bar.exe to foo.exe?
>You just can't do that on UNIX.
Famous last words...

Well, not to argue about the surprises about globbing.  Yes pip is a fine
program, I used it a great deal on an H89.

pip foo.\* = bar.\*

I realize that you may not like quoting mechanisms, but what about consistant
schemes for the use of wild carding?  Do I have to remember who does it which
way?  That seems even more annoying then having to use quoting mechanisms.

-*or*-

In your startup file
set noglob

Later that evening...
prompt> pip foo.* = bar.*

If the shell/CLI allows global wildcard expansion to be turned off, then people
can have it the way they like it and the OS/shell writer does not have to see
the future in order to make them all very happy (I have seen the future, and
it contains beer :-).

BTW: unix Csh shell script for pip

#!/bin/csh
#
# Pip	a DECism/CPMism	(peripheral interchange program)
#
# Usage:  pip dst.\* = source.*
#                -or-
#         pip dst.\* = source.\*
#
#first argument
set noglob
set to=$argv[1]:r
unset noglob

#third and later arguments, expand wild card if needed
shift argv
shift argv
set from="$argv"
#echo FROM $from TO ${to}.EXT

foreach file ( $from )
	set ext=$file:e
	cp $file ${to}.$ext
end

-- 
=
    Jim Hutchison   		UUCP:	{dcdwest,ucbvax}!sdcsvax!hutch
		    		ARPA:	Hutch@sdcsvax.ucsd.edu
panic -- no witty phrase