Globbing in csh

Jonathan I. Kamens jik at athena.mit.edu
Mon Feb 18 08:16:59 AEST 1991


  Using the "makealias" and "quote" aliases by Dan Bernstein (brnstnd at nyu.edu):

    % makealias mycat
    cat `ls | sed '1,/!*/d'` | less
    alias mycat 'cat `ls | sed '\''1,/\!*/d'\''` | less'

I typed the "makealias mycat" command and the line starting with "cat", and
got back an alias with all of the quoting correctly done.  That line is what
you would use to define the alias.

  And here are Dan's aliases, in case you want to do this again with something
else:

    alias quote     "/bin/sed 's/\\!/\\\\\!/g' | /bin/sed 's/'\\\''/'\\\'\\\\\\\'\\\''/g' | /bin/sed 's/^/'\''/' | /bin/sed 's/"\$"/'\''/'"
    alias makealias "quote | /bin/sed 's/^/alias \!:1 /' \!:2*"

Pretty gross, but they do the job....

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list