Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Ex-bash script for optimisation
- X-seq: zsh-users 8598
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Ex-bash script for optimisation
- Date: Sun, 13 Mar 2005 18:46:23 +0000
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <62u0315opl6kubat89fmdng5dg4m4370o0@xxxxxxx> <42308ED6.6030007@xxxxxxx> <1050311044847.ZM9336@xxxxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
On Fri, 11 Mar 2005 04:48:46 +0000, wrote:
>
>#--- snip ---
>setopt local_options extended_glob null_glob
>filelst=( *$1*~*.(aux|toc|dvi|aux|exe|obj|zip|pdf|mdb|xls|bak|swp|log|jpg|gif|tiff|jpeg|bmp) )
>#--- snip ---
>
>If you want to allow $1 to be a pattern rather than a fixed string, you
>need *${~1}* instead.
>
>If you want to allow multiple arguments to the script, you need *${^*}*
>or for multiple patterns *${^~*}*
>
Bart
Only the first example worked for me, but I found $1 could be a pattern, and i could set a second
parameter w/o problem
setopt local_options extended_glob null_glob
filelst=( *$1*~*.(aux|toc|dvi|aux|exe|obj|zip|pdf|mdb|xls|bak|swp|log|jpg|gif|tiff|jpeg|bmp) )
if (( ${#filelst} ))
then
echo "file list : " $filelst
gvim.exe ${filelst[*]} &
else
echo "Sorry no file matched *$1*"
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author