Re: Get the parameter pattern from command line
am 02.04.2008 03:51:57 von Alvin SIUOn Mar 30, 2:15=A0pm, mop2
wrote:
> 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=3D'v(){ viewfile.ksh $*;set +f;};set -f;v'
>
> $ viewfile e*.txt
> Filter: e*.txt
> energy.txt =A0english.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.
Thanks mops.
The v() method really works.
But, I have to modify a little to handle the toggle of the name
substitution.
Ha Ha, anyway, this is just another small headache which can be
solved.
Bye.
Alvin SIU