Re: Get the parameter pattern from command line

An idea, not very elegant, but it works.
The alias line must be inserted in /etc/profile or ~/.profile
I think this solution, with alias and function concepts, is ok for
bash and ksh93.

$ cat viewfile.ksh
#!/bin/ksh
echo "Filter: $*"
ls $*

$ alias viewfile='v(){ viewfile.ksh $*;set +f;};set -f;v'

$ viewfile e*.txt
Filter: e*.txt
energy.txt english.txt

Another solution can be the removal of the first line of viewfile.ksh.
In this way, the current interactive shell will be used, I think, but
the script has to be adapted to work properly with any of
the two shells.
mop2 [ So, 30 März 2008 08:15 ] [ ID #1932348 ]
Linux » comp.unix.shell » Re: Get the parameter pattern from command line

Vorheriges Thema: Re: while /usr/bin/read
Nächstes Thema: Re: script to verify if server is up