zsh-users
 help / color / mirror / code / Atom feed
* Re: Ex-bash script for optimisation
@ 2005-03-10 18:42 Meino Christian Cramer
  2005-03-11  5:14 ` Bart Schaefer
  0 siblings, 1 reply; 20+ messages in thread
From: Meino Christian Cramer @ 2005-03-10 18:42 UTC (permalink / raw)
  To: zsh-users

Hi,

 I checked the zshall manpage, but I fear to have overlocked the
 specific line which explains, for what I am using for.

 I want to limit the expand function (that one called when pressing
 TAB after entering for example "cd") to file of the current working
 directory or in other words I want to switch off the global search for
 expansion possibilities...

 How can I achieve this?

 Thank you very much for any help and hints in advance ! :)
 Keep zsh'ing! ;)
 Meino


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Ex-bash script for optimisation
@ 2005-03-10 16:43 zzapper
  2005-03-10 18:15 ` Peter Miller
  0 siblings, 1 reply; 20+ messages in thread
From: zzapper @ 2005-03-10 16:43 UTC (permalink / raw)
  To: zsh-users

Hi
Q1) Is there a better way to generate the array filelst
Q2) the line "for x in *$1*" fails is no match, how can i "catch" this

#!/bin/zsh
# v
# description : vi all files containing $1 in name
#               but excluding non-text files
set +x

filebad=''
filelst=()
filenum='1'
for x in *$1*
do
   if [[ "$x" == *.(aux|toc|dvi|aux|exe|obj|zip|pdf|mdb|xls|bak|swp|log|jpg|gif|tiff|jpeg|bmp) ]]
   then
      let filebad=1
   else 
      if [ -f $x ]
      then
      filelst[$filenum]=$x
      let filenum=filenum+1
      fi
   fi
done

if (( ${#filelst} ))
then
echo "file list : " $filelst
gvim.exe ${filelst[*]} &
else
echo "sorry no file matched *$1*"
fi



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2005-03-14 18:18 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-10 18:42 Ex-bash script for optimisation Meino Christian Cramer
2005-03-11  5:14 ` Bart Schaefer
2005-03-11 18:37   ` TAB-expansion problems Meino Christian Cramer
2005-03-12  9:15     ` Tim Kruse
2005-03-13  4:50     ` Bart Schaefer
2005-03-13  8:54       ` Meino Christian Cramer
2005-03-13 17:21         ` Bart Schaefer
2005-03-14  4:37           ` ESC-Question Meino Christian Cramer
2005-03-14  7:44             ` ESC-Question Philippe Troin
2005-03-14 16:58               ` ESC-Question Meino Christian Cramer
2005-03-14 17:09                 ` ESC-Question Peter Stephenson
2005-03-14 17:22                   ` ESC-Question Meino Christian Cramer
2005-03-14 18:18                   ` ESC-Question Philippe Troin
2005-03-14 10:01             ` ESC-Question Sami Samhuri
  -- strict thread matches above, loose matches on Subject: below --
2005-03-10 16:43 Ex-bash script for optimisation zzapper
2005-03-10 18:15 ` Peter Miller
2005-03-11  4:48   ` Bart Schaefer
2005-03-11  9:04     ` zzapper
2005-03-13 18:46     ` zzapper
2005-03-13 19:23       ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).