Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Command != command ???
- X-seq: zsh-users 9167
 
- From: Meino Christian Cramer <Meino.Cramer@xxxxxx>
 
- To: phil@xxxxxxxx
 
- Subject: Re: Command != command ???
 
- Date: Mon, 25 Jul 2005 20:00:29 +0200 (CEST)
 
- Cc: zsh-users@xxxxxxxxxx
 
- In-reply-to: <87r7dnsvjn.fsf@xxxxxxxxxxxxxxxx>
 
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
 
- References: <20050724.074251.74755659.Meino.Cramer@xxxxxx>	<87r7dnsvjn.fsf@xxxxxxxxxxxxxxxx>
 
From: Philippe Troin <phil@xxxxxxxx>
Subject: Re: Command != command ???
Date: 24 Jul 2005 15:12:28 -0700
> Meino Christian Cramer <Meino.Cramer@xxxxxx> writes:
> 
> > Hi,
> > 
> >  In the root of the directory tree, which is filled which snapshots
> >  from my digicam I submitted the command:
> > 
> > 	  print **/*.jpg
> > 
> >  which printf out all filenames of my snaphots. FINE ! :)
> > 
> >  Then I wrote this script:
> > 
> >      #!/bin/zsh
> > 	 # gather EXIF-data
> > 	  
> >      if [ ! -d ./EXIF ]
> >      then
> >          mkdir ./EXIF ]
> >      fi    
> >      
> >      for i in **/*.jpg                       <<<---- line 7
> >      do
> >          echo "examine $i..."
> >          idx=0;
> >          fn=$(basename $i .jpg)
> >          fnex=${fn}.exif-${idx}.txt	
> >          while [ -f ./EXIF/${fnex} ]
> >          do
> >              idx=$(( idx + 1 ))
> >              fnex=${fn}.exif-${idx}.txt
> >          done
> >          jhead -v $i > ./EXIF/${fnex}
> >      done
> > 
> > 
> >   which I started from the same point, where I did my
> > 
> > 	  print **/*.jpg
> > 
> >   but now, zsh said to me:
> > 
> >       ./mkexif.sh:7: no matches found: **/*.jpg
> 
> You setopt extendglob in your zshrc, which is not sourced for your script.
> 
> Either move the setopt to zshenv, or add setopt extendedglob to your
> script.
> 
> Phil.
Hmmm....my script now looks like this:
   #!/bin/zsh
   setopt extendedglob
   if [ ! -d ./EXIF ]
   then
       mkdir ./EXIF ]
   fi    
   
   for i in **/*.jpg                    <<<<<---- line 9
   do
       echo -n "examine $i..."
       idx=0;
       fn=$(basename $i .jpg)
       fnex=${fn}.exif-${idx}.txt
       while [ -f ./EXIF/${fnex} ]
       do
           idx=$(( idx + 1 ))
           fnex=${fn}.exif-${idx}.txt
       done
       print "...writing ./EXIF/${fnex}"
       jhead -v $i > ./EXIF/${fnex}
   done
...but...still getting this:
./mkexif.sh:9: no matches found: **/*.jpg
After all this I must confess: My confusion became now one of my 
lesser problems... ;O)
Confused,
 Meino
Messages sorted by:
Reverse Date,
Date,
Thread,
Author