zsh-users
 help / color / mirror / code / Atom feed
* Command != command ???
@ 2005-07-24  5:42 Meino Christian Cramer
  2005-07-24 22:12 ` Philippe Troin
  0 siblings, 1 reply; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-24  5:42 UTC (permalink / raw)
  To: zsh-users

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

  ("mkexif.sh" is the name of the script, line 7 is marked)

 
  Do I have to less coffee in my head, or what is wrong here ? :O)
  I dont see the bug...but sure there is one, at least in front of
  my monitor.... ;O)

  Thanks for any help in advance !

  Have a nice sunday!
  Meino


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

* Re: Command != command ???
  2005-07-24  5:42 Command != command ??? Meino Christian Cramer
@ 2005-07-24 22:12 ` Philippe Troin
  2005-07-24 23:22   ` Bart Schaefer
                     ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Philippe Troin @ 2005-07-24 22:12 UTC (permalink / raw)
  To: Meino Christian Cramer; +Cc: zsh-users

Meino Christian Cramer <Meino.Cramer@gmx.de> 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.


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

* Re: Command != command ???
  2005-07-24 22:12 ` Philippe Troin
@ 2005-07-24 23:22   ` Bart Schaefer
  2005-07-25  3:06   ` Meino Christian Cramer
  2005-07-25 18:00   ` Meino Christian Cramer
  2 siblings, 0 replies; 23+ messages in thread
From: Bart Schaefer @ 2005-07-24 23:22 UTC (permalink / raw)
  To: zsh-users

On Jul 24,  3:12pm, Philippe Troin wrote:
} Subject: Re: Command != command ???
}
} Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
} 
} >       ./mkexif.sh:7: no matches found: **/*.jpg
} 
} You setopt extendglob in your zshrc, which is not sourced for your
} script.

Good guess, but extendedglob is not required for **/ to work.

More likely is that there is a "cd" command in some startup file
that the script *does* read, such as ~/.zshenv.

Try changing the script to start with

    #!/bin/zsh -x

so you can see a trace of the commands that it is executing.  Remove
the -x again after you fix whatever is wrong, of course.


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

* Re: Command != command ???
  2005-07-24 22:12 ` Philippe Troin
  2005-07-24 23:22   ` Bart Schaefer
@ 2005-07-25  3:06   ` Meino Christian Cramer
  2005-07-25  3:32     ` Philippe Troin
  2005-07-25 18:00   ` Meino Christian Cramer
  2 siblings, 1 reply; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-25  3:06 UTC (permalink / raw)
  To: phil; +Cc: zsh-users

From: Philippe Troin <phil@fifi.org>
Subject: Re: Command != command ???
Date: 24 Jul 2005 15:12:28 -0700



> Meino Christian Cramer <Meino.Cramer@gmx.de> 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.

Thank you for you reply.

I have set extendedglob in my .zshrc...is that not sufficient ?

Meino 


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

* Re: Command != command ???
  2005-07-25  3:06   ` Meino Christian Cramer
@ 2005-07-25  3:32     ` Philippe Troin
  2005-07-25  3:45       ` Meino Christian Cramer
  2005-07-25  3:54       ` Bart Schaefer
  0 siblings, 2 replies; 23+ messages in thread
From: Philippe Troin @ 2005-07-25  3:32 UTC (permalink / raw)
  To: Meino Christian Cramer; +Cc: zsh-users

Meino Christian Cramer <Meino.Cramer@gmx.de> writes:

> > 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.
> 
> Thank you for you reply.
> 
> I have set extendedglob in my .zshrc...is that not sufficient ?

.zshrc is only sourced for interactive shell.  A script is considered
non-interactive.  .zshenv is *always* loaded (except if your admin
unsetopt's RCS in /etc/zshenv, but that would be idiotic).  Yet,
that's not the answer to your problems.

No, Bart's right in <1050724232221.ZM26877@candle.brasslantern.com>.
Extended_glob is not necessary for **.

Yet, the manual states (FILENAME GENERATION > Recursive Globbing):

       As a shorthand, `**/' is equivalent to `(*/)#'; note  that
       this  therefore  matches files in the current directory as
       well as subdirectories.

And earlier on (FILENAME GENERATION > Glob Operators):

       x#     (Requires EXTENDED_GLOB to be set.)   Matches  zero
              or  more occurrences of the pattern x. 

Should we fix the manual?

Phil.


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

* Re: Command != command ???
  2005-07-25  3:32     ` Philippe Troin
@ 2005-07-25  3:45       ` Meino Christian Cramer
  2005-07-25  4:14         ` Philippe Troin
  2005-07-25  3:54       ` Bart Schaefer
  1 sibling, 1 reply; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-25  3:45 UTC (permalink / raw)
  To: phil; +Cc: zsh-users

From: Philippe Troin <phil@fifi.org>
Subject: Re: Command != command ???
Date: 24 Jul 2005 20:32:38 -0700

> Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
> 
> > > 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.
> > 
> > Thank you for you reply.
> > 
> > I have set extendedglob in my .zshrc...is that not sufficient ?
> 
> .zshrc is only sourced for interactive shell.  A script is considered
> non-interactive.  .zshenv is *always* loaded (except if your admin
> unsetopt's RCS in /etc/zshenv, but that would be idiotic).  Yet,
> that's not the answer to your problems.
> 
> No, Bart's right in <1050724232221.ZM26877@candle.brasslantern.com>.
> Extended_glob is not necessary for **.
> 
> Yet, the manual states (FILENAME GENERATION > Recursive Globbing):
> 
>        As a shorthand, `**/' is equivalent to `(*/)#'; note  that
>        this  therefore  matches files in the current directory as
>        well as subdirectories.
> 
> And earlier on (FILENAME GENERATION > Glob Operators):
> 
>        x#     (Requires EXTENDED_GLOB to be set.)   Matches  zero
>               or  more occurrences of the pattern x. 
> 
> Should we fix the manual?
> 
> Phil.
> 

I am a little confused here -- seems that what I believed to know
previously is wrong...

...I am booting my linux box directly into an X-Server with a kdm
login...The shell I start then is...interactively, right? .zshrc
setopts my extendedglob...then I start a script from there...which
again is not interactively...and will "loose" some features I set in
my .zshrc...

Is this correct?

Is there a list where I can identify those features, which are not
valid for scripts, if set in .zshrc? Or do I have to read through the
whole zshall manpage?

Meino


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

* Re: Command != command ???
  2005-07-25  3:32     ` Philippe Troin
  2005-07-25  3:45       ` Meino Christian Cramer
@ 2005-07-25  3:54       ` Bart Schaefer
  2005-07-25  4:15         ` Philippe Troin
  1 sibling, 1 reply; 23+ messages in thread
From: Bart Schaefer @ 2005-07-25  3:54 UTC (permalink / raw)
  To: zsh-users

On Jul 24,  8:32pm, Philippe Troin wrote:
}
} Extended_glob is not necessary for **.

Note that ** is the same as *.  Only **/ is special -- the slash is
a necessary part of the token.

} Yet, the manual states (FILENAME GENERATION > Recursive Globbing):
} 
}        As a shorthand, `**/' is equivalent to `(*/)#'; note  that
}        this  therefore  matches files in the current directory as
}        well as subdirectories.
} 
} And earlier on (FILENAME GENERATION > Glob Operators):
} 
}        x#     (Requires EXTENDED_GLOB to be set.)   Matches  zero
}               or  more occurrences of the pattern x. 
} 
} Should we fix the manual?

The first bit that you quoted is talking about semantics.  The second
excerpt is talking about syntax.  There is nothing to fix; "equivalent
to" does not mean "may always be typographically replaced by".


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

* Re: Command != command ???
  2005-07-25  3:45       ` Meino Christian Cramer
@ 2005-07-25  4:14         ` Philippe Troin
  2005-07-25 16:06           ` Meino Christian Cramer
  0 siblings, 1 reply; 23+ messages in thread
From: Philippe Troin @ 2005-07-25  4:14 UTC (permalink / raw)
  To: Meino Christian Cramer; +Cc: zsh-users

Meino Christian Cramer <Meino.Cramer@gmx.de> writes:

> I am a little confused here -- seems that what I believed to know
> previously is wrong...
> 
> ...I am booting my linux box directly into an X-Server with a kdm
> login...The shell I start then is...interactively, right? .zshrc
> setopts my extendedglob...then I start a script from there...which
> again is not interactively...and will "loose" some features I set in
> my .zshrc...
> 
> Is this correct?

No, when you start a zsh script (A) from a zsh "interactive session"
shell (B), A starts completely anew.  The only thing inherited from B
by A are the environment variables and some other irrelevant state
(opened file descriptors, limits, etc).  All the rest (options, etc)
is lost.

> Is there a list where I can identify those features, which are not
> valid for scripts, if set in .zshrc? Or do I have to read through the
> whole zshall manpage?

In a nutshell:

  zshenv is always read in all non-pathological cases

  zprofile is read if your shell is a login shell

  zshrc is read if your shell is interactive

  zlogin is read if your shell is a login shell

So zprofile and zlogin are equivalent except for the sourcing order
(if one is read, the other is read too).

We have four combinations:

  login and interactive: this is the case when logging in through
  telnet, ssh, and sometimes for shells started by X terminal
  emulators (depending on your settings);

  login and non-interactive: I've only seen it used by some display
  managers when you login (most recent gdm/kdm versions do that, as
  well as CDE);

  non-login interactive: eg. a sub-shell, opened by zsh itself or from
  vi, screen, etc;

  non-login and non-interactive: scripts.

I myself use .zshenv, .zprofile and .zshrc this way:

  In .zshenv, I put: 

      environment variables definitions: bracketed by an if statement,
      and only executed if SOME_VARIABLE is unset.  SOME_VARIABLE is
      set at the end of zshenv);

      some kind of aliases or autoloads: For example ll='ls -l',
      because I want to use ll like this some times: 'ssh machine ll
      /some/dir';

      all the options that are not relevant to interactive use but
      which I may use via 'ssh machine command' (eg. rc_quotes,
      magicequalsubst, etc).

  In .zprofile, I do once-a-time initialization (eg. run under
  ssh-agent if not already), terminal initialization, limits settings,
  everything that's inherited from process to sub-process.

  Finally .zshrc takes care of: completions, zle and keyboard
  settings, prompts, and interactive setopts and autoloads.

Phil.


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

* Re: Command != command ???
  2005-07-25  3:54       ` Bart Schaefer
@ 2005-07-25  4:15         ` Philippe Troin
  0 siblings, 0 replies; 23+ messages in thread
From: Philippe Troin @ 2005-07-25  4:15 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

Bart Schaefer <schaefer@brasslantern.com> writes:

> On Jul 24,  8:32pm, Philippe Troin wrote:
> }
> } Extended_glob is not necessary for **.
> 
> Note that ** is the same as *.  Only **/ is special -- the slash is
> a necessary part of the token.
> 
> } Yet, the manual states (FILENAME GENERATION > Recursive Globbing):
> } 
> }        As a shorthand, `**/' is equivalent to `(*/)#'; note  that
> }        this  therefore  matches files in the current directory as
> }        well as subdirectories.
> } 
> } And earlier on (FILENAME GENERATION > Glob Operators):
> } 
> }        x#     (Requires EXTENDED_GLOB to be set.)   Matches  zero
> }               or  more occurrences of the pattern x. 
> } 
> } Should we fix the manual?
> 
> The first bit that you quoted is talking about semantics.  The second
> excerpt is talking about syntax.  There is nothing to fix; "equivalent
> to" does not mean "may always be typographically replaced by".

Fair enough.

Phil.


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

* Re: Command != command ???
  2005-07-25  4:14         ` Philippe Troin
@ 2005-07-25 16:06           ` Meino Christian Cramer
  0 siblings, 0 replies; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-25 16:06 UTC (permalink / raw)
  To: phil; +Cc: zsh-users

From: Philippe Troin <phil@fifi.org>
Subject: Re: Command != command ???
Date: 24 Jul 2005 21:14:46 -0700

Hi,

 The Tao of ZSH

 First Mantra

 the novice once asked the master guru: "Why are my scripts not
 executed though they are well designed?"

 The master guru only wrotes down a few words only.

 Then the novice was enlighted.

 ----

 Sometimes only a few well formed words in a simple mail are worth a
 lot more than The Stories of One Thousand and one arabian Nights of
 zshall. 

 Thanks so much, Philippe!  :O)

 (Could you please do the same miracle with the completion system ? ;)

 Happy zshing!
 Novice
  Meino

> Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
> 
> > I am a little confused here -- seems that what I believed to know
> > previously is wrong...
> > 
> > ...I am booting my linux box directly into an X-Server with a kdm
> > login...The shell I start then is...interactively, right? .zshrc
> > setopts my extendedglob...then I start a script from there...which
> > again is not interactively...and will "loose" some features I set in
> > my .zshrc...
> > 
> > Is this correct?
> 
> No, when you start a zsh script (A) from a zsh "interactive session"
> shell (B), A starts completely anew.  The only thing inherited from B
> by A are the environment variables and some other irrelevant state
> (opened file descriptors, limits, etc).  All the rest (options, etc)
> is lost.
> 
> > Is there a list where I can identify those features, which are not
> > valid for scripts, if set in .zshrc? Or do I have to read through the
> > whole zshall manpage?
> 
> In a nutshell:
> 
>   zshenv is always read in all non-pathological cases
> 
>   zprofile is read if your shell is a login shell
> 
>   zshrc is read if your shell is interactive
> 
>   zlogin is read if your shell is a login shell
> 
> So zprofile and zlogin are equivalent except for the sourcing order
> (if one is read, the other is read too).
> 
> We have four combinations:
> 
>   login and interactive: this is the case when logging in through
>   telnet, ssh, and sometimes for shells started by X terminal
>   emulators (depending on your settings);
> 
>   login and non-interactive: I've only seen it used by some display
>   managers when you login (most recent gdm/kdm versions do that, as
>   well as CDE);
> 
>   non-login interactive: eg. a sub-shell, opened by zsh itself or from
>   vi, screen, etc;
> 
>   non-login and non-interactive: scripts.
> 
> I myself use .zshenv, .zprofile and .zshrc this way:
> 
>   In .zshenv, I put: 
> 
>       environment variables definitions: bracketed by an if statement,
>       and only executed if SOME_VARIABLE is unset.  SOME_VARIABLE is
>       set at the end of zshenv);
> 
>       some kind of aliases or autoloads: For example ll='ls -l',
>       because I want to use ll like this some times: 'ssh machine ll
>       /some/dir';
> 
>       all the options that are not relevant to interactive use but
>       which I may use via 'ssh machine command' (eg. rc_quotes,
>       magicequalsubst, etc).
> 
>   In .zprofile, I do once-a-time initialization (eg. run under
>   ssh-agent if not already), terminal initialization, limits settings,
>   everything that's inherited from process to sub-process.
> 
>   Finally .zshrc takes care of: completions, zle and keyboard
>   settings, prompts, and interactive setopts and autoloads.
> 
> Phil.
> 


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

* Re: Command != command ???
  2005-07-24 22:12 ` Philippe Troin
  2005-07-24 23:22   ` Bart Schaefer
  2005-07-25  3:06   ` Meino Christian Cramer
@ 2005-07-25 18:00   ` Meino Christian Cramer
  2005-07-25 18:24     ` Philippe Troin
  2 siblings, 1 reply; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-25 18:00 UTC (permalink / raw)
  To: phil; +Cc: zsh-users

From: Philippe Troin <phil@fifi.org>
Subject: Re: Command != command ???
Date: 24 Jul 2005 15:12:28 -0700

> Meino Christian Cramer <Meino.Cramer@gmx.de> 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


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

* Re: Command != command ???
  2005-07-25 18:00   ` Meino Christian Cramer
@ 2005-07-25 18:24     ` Philippe Troin
  2005-07-25 18:53       ` Meino Christian Cramer
  0 siblings, 1 reply; 23+ messages in thread
From: Philippe Troin @ 2005-07-25 18:24 UTC (permalink / raw)
  To: Meino Christian Cramer; +Cc: zsh-users

Meino Christian Cramer <Meino.Cramer@gmx.de> writes:

> Hmmm....my script now looks like this:
> 
>    #!/bin/zsh
>    setopt extendedglob

As mentionned earlier on in the thread, this is not necessary anymore.

> 
>    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)

Try running the script as:

  /bin/zsh -x script

And send us the result.  As Bart wrote, it might be some of your ~/.z*
files messing up the cwd.

Phil.


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

* Re: Command != command ???
  2005-07-25 18:24     ` Philippe Troin
@ 2005-07-25 18:53       ` Meino Christian Cramer
  2005-07-25 19:20         ` Philippe Troin
  0 siblings, 1 reply; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-25 18:53 UTC (permalink / raw)
  To: phil; +Cc: zsh-users

From: Philippe Troin <phil@fifi.org>
Subject: Re: Command != command ???
Date: 25 Jul 2005 11:24:56 -0700

Thanks a lot for all your help ! ! !

My current "organisation" of my .z*-Files

I have split the .zshrc in files like:
.zsh.options, .zsh.functions etc which all are
sourced from .Zshrc like this

		source $HOME/.zsh.options

I think, this is the same as if their script text would be a
part of .zshrc itsself.

Any other file "works" the "normal way":

Furthermore, I stripped the script to just the suspicious lines, a
dump of it can be found in the beginning of the following logfile (the
symptoms are the same...I only removed some escape sequences from the
PROMPT string, which otherwise would clutter the output.)


Script started on Mon Jul 25 20:43:47 2005

cat ./globtest


#!/bin/zsh
setopt extendedglob
print -l **/*.jpg




/bin/zsh -x ./globtest

+/etc/zsh/zshenv:19> export 'mccinitlogger=:/etc/profile:/etc/profile:/etc/profile:/etc/profile'
+/etc/zsh/zshenv:37> [ -d /usr/local/sbin ']'
+/etc/zsh/zshenv:38> pathman /usr/local/sbin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/local/sbin($|:)'
+/etc/zsh/zshenv:41> [ -d /usr/sbin ']'
+/etc/zsh/zshenv:42> pathman /usr/sbin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/sbin($|:)'
+/etc/zsh/zshenv:45> [ -d /sbin ']'
+/etc/zsh/zshenv:46> pathman /sbin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/sbin($|:)'
+/etc/zsh/zshenv:49> [ -d /usr/local/bin ']'
+/etc/zsh/zshenv:50> pathman /usr/local/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/local/bin($|:)'
+/etc/zsh/zshenv:53> [ -d /usr/bin ']'
+/etc/zsh/zshenv:54> pathman /usr/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/bin($|:)'
+/etc/zsh/zshenv:58> [ -d /usr/X11R6/bin ']'
+/etc/zsh/zshenv:59> pathman /usr/X11R6/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/X11R6/bin($|:)'
+/etc/zsh/zshenv:62> [ -d /usr/teTeX/bin/i686-pc-linux-gnu ']'
+/etc/zsh/zshenv:63> pathman /usr/teTeX/bin/i686-pc-linux-gnu last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/teTeX/bin/i686-pc-linux-gnu($|:)'
+/etc/zsh/zshenv:66> [ -d /usr/netpbm/bin ']'
+/etc/zsh/zshenv:67> pathman /usr/netpbm/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/netpbm/bin($|:)'
+/etc/zsh/zshenv:70> [ -d /usr/ImgStar/Bin ']'
+/etc/zsh/zshenv:71> pathman /usr/ImgStar/Bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/usr/ImgStar/Bin($|:)'
+/etc/zsh/zshenv:74> [ -d /opt/gnome/bin ']'
+/etc/zsh/zshenv:75> pathman /opt/gnome/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/opt/gnome/bin($|:)'
+/etc/zsh/zshenv:78> [ -d /opt/kde/bin ']'
+/etc/zsh/zshenv:79> pathman /opt/kde/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/opt/kde/bin($|:)'
+/etc/zsh/zshenv:83> [ -d /opt/qt/bin ']'
+/etc/zsh/zshenv:84> pathman /opt/qt/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/opt/qt/bin($|:)'
+/etc/zsh/zshenv:87> [ -d /opt/testinstall/bin ']'
+/etc/zsh/zshenv:88> pathman /opt/testinstall/bin last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/opt/testinstall/bin($|:)'
+/etc/zsh/zshenv:91> [ -d /opt/openoffice/program ']'
+/etc/zsh/zshenv:92> pathman /opt/openoffice/program last
+pathman:1> echo /opt/gcc-3.4.n/bin/:/opt/gcc-3.4.n/bin/:/opt/kde/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/teTeX/bin/i686-pc-linux-gnu:/usr/netpbm/bin:/usr/ImgStar/Bin:/opt/gnome/bin:/opt/qt/bin:/opt/testinstall/bin:/opt/openoffice/program:/home/mccramer/bin:/home/mccramer/bin
+pathman:1> /bin/egrep -q '(^|:)/opt/openoffice/program($|:)'
+/etc/zsh/zshenv:95> [ -d /usr/mysql/bin ']'
+/etc/zsh/zshenv:99> [ -d /opt/kde/sbin ']'
+/etc/zsh/zshenv:103> [ -d /opt/mozilla/bin ']'
+/etc/zsh/zshenv:125> [ -z '' -a ! -f /home/mccramer/.inputrc ']'
+/etc/zsh/zshenv:130> [ -f /etc/dircolors ']'
+/etc/zsh/zshenv:139> export PATH HISTSIZE PS1 LS_COLORS INPUTRC
+/etc/zsh/zshenv:142> export 'KDEWM=/usr/bin/icewm'
+/etc/zsh/zshenv:145> export 'MEPATH=/usr/share/me'
+/home/mccramer/.zshenv:4> export 'TERM=xterm-color'
+/home/mccramer/.zshenv:9> export 'CFLAGS=-O3 -m3dnow -march=athlon-xp -mcpu=athlon-xp -mfpmath=sse -funroll-loops -fomit-frame-pointer -fforce-mem -fforce-addr -finline-functions -falign-functions=4 -mpreferred-stack-boundary=2'
+/home/mccramer/.zshenv:12> export 'MAIL=/var/spool/mail/mccramer'
+/home/mccramer/.zshenv:14> export 'LESSOPEN=|/usr/bin/lesspipe.sh %s'
+/home/mccramer/.zshenv:15> export 'LESS='
+/home/mccramer/.zshenv:17> export 'HELPDIR=/usr/local/lib/zsh/help'
+/home/mccramer/.zshenv:26> export 'CXXFLAGS=-O3 -m3dnow -march=athlon-xp -mcpu=athlon-xp -mfpmath=sse -funroll-loops -fomit-frame-pointer -fforce-mem -fforce-addr -finline-functions -falign-functions=4 -mpreferred-stack-boundary=2'
+/home/mccramer/.zshenv:28> export 'PKG_CONFIG_PATH=/usr/lib/pkgconfig'
+/home/mccramer/.zshenv:31> export 'AXIOM=/usr/axiom/mnt/linux'
+/home/mccramer/.zshenv:34> export 'GNOME_PREFIX=/opt/gnome'
+/home/mccramer/.zshenv:35> export 'GNOME_LIBCONFIG_PATH=/usr/lib'
+/home/mccramer/.zshenv:39> export 'PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/gnome/lib/pkgconfig:/opt/kde/lib/pkgconfig'
+/home/mccramer/.zshenv:43> export 'PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/gnome/lib/pkgconfig:/opt/kde/lib/pkgconfig:/usr/X11R6/lib/pkgconfig'
+/home/mccramer/.zshenv:51> export 'PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/gnome/lib/pkgconfig:/opt/kde/lib/pkgconfig:/usr/X11R6/lib/pkgconfig:/opt/mozilla/lib/pkgconfig'
+/home/mccramer/.zshenv:61> export 'PYTHONPATH=/usr/lib/python2.3:/home/mccramer:/usr/lib/python2.3/plat-linux2:/usr/lib/python2.3/lib-tk:/usr/lib/python2.3/lib-dynload:/usr/lib/python2.3/site-packages'
+/home/mccramer/.zshenv:62> export 'PYTHONHOME=/usr'
+/home/mccramer/.zshenv:65> export 'MEUSERPATH=/home/mccramer/.me'
+/home/mccramer/.zshenv:68> export 'LESS=-R'
+/home/mccramer/.zshenv:74> export 'XDG_DATA_DIRS=/root/.local/share:/usr/local/share/:/usr/share/:/opt/gnome2/share:/opt/gnome2/share/'
+/home/mccramer/.zshenv:78> export G_BROKEN_FILENAMES
+/home/mccramer/.zshenv:79> export G_FILENAME_ENCODING
+/home/mccramer/.zshenv:82> export 'TEXDOCVIEW_dvi=kgh %s'
+/home/mccramer/.zshenv:83> export 'TEXDOCVIEW_pdf=kgh %s'
+/home/mccramer/.zshenv:84> export 'TEXDOCVIEW_ps=kghostview %s'
+/home/mccramer/.zshenv:85> export 'TEXDOCVIEW_html=dillo %s'
+/home/mccramer/.zshenv:88> export 'FRACTDIR=/usr/share/xfractint'
+/home/mccramer/.zshenv:89> export 'SRCDIR=/home/mccramer/xfractint'
+/home/mccramer/.zshenv:91> export 'QTDIR=/opt/qt'
+/home/mccramer/.zshenv:93> export 'PS1=[\W/] :'
+/home/mccramer/.zshenv:95> export 'LESSOPEN=|/usr/bin/lesspipe.sh %s'
+/home/mccramer/.zshenv:96> export 'LESS='
+/home/mccramer/.zshenv:98> export 'PERLIO=stdio'
+/home/mccramer/.zshenv:100> export 'PILOTPORT=/dev/tts/0'
+/home/mccramer/.zshenv:102> export 'MC_COLOR_TABLE=base_color=normal=blue,lightgray:normal=blue,lightgray:menuhot=red,cyan:menuhotsel=red,cyan:directory=blue,lightgray:executable=blue,lightgray:link=red,lightgray:device=blue,lightgray:special=blue,lightgray:core=blue,lightgray:hidden=blue,lightgray:temp=blue,lightgray:doc=blue,lightgray:archive=blue,lightgray:source=blue,lightgray:media=blue,lightgray:graph=blue,lightgray:database=blue,lightgray:marked=black,yellow:stalelink=black,brightred:editnormal=blue,lightgray'
+/home/mccramer/.zshenv:125> export 'EDITOR=vim'
+/home/mccramer/.zshenv:128> export 'QTDIR=/opt/qt'
+/home/mccramer/.zshenv:131> export 'G_BROKEN_FILENAMES='
+/home/mccramer/.zshenv:134> export 'KDEDIR=/opt/kde'
+/home/mccramer/.zshenv:136> export 'KDEDIRS=/opt/kde'
+/home/mccramer/.zshenv:143> export PATH HISTSIZE LS_COLORS INPUTRC
+/home/mccramer/.zshenv:144> export 'KDEWM=/usr/bin/icewm'
+/home/mccramer/.zshenv:1> dircolors /home/mccramer/.DIR_COLORS
+/home/mccramer/.zshenv:146> eval 'LS_COLORS='\''no=00:fi=00:di=00;32:ln=00;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=00;31:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=00;31:*.tgz=01;31:*.bz2=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.ZIP=01;31:*.z=01;31:*.7z=01;31:*.Z=01;31:*.gz=01;31:*.rpm=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.png=01;35:*.pgm=01;35:*.ppm=01;35:*.pnm=01;35:*.pcx=01;35:*.xbm=01;35:*.xpm=01;35:*.xcf=01;35:*.tif=01;35:*.GIF=01;35:*.BMP=01;35:*.PNG=01;35:*.PGM=01;35:*.PPM=01;35:*.PNM=01;35:*.PCX=01;35:*.XBM=01;35:*.XPM=01;35:*.XCF=01;35:*.TIF=01;35:'\'';' export LS_COLORS
+(eval):1> LS_COLORS='no=00:fi=00:di=00;32:ln=00;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=00;31:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=00;31:*.tgz=01;31:*.bz2=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.ZIP=01;31:*.z=01;31:*.7z=01;31:*.Z=01;31:*.gz=01;31:*.rpm=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.png=01;35:*.pgm=01;35:*.ppm=01;35:*.pnm=01;35:*.pcx=01;35:*.xbm=01;35:*.xpm=01;35:*.xcf=01;35:*.tif=01;35:*.GIF=01;35:*.BMP=01;35:*.PNG=01;35:*.PGM=01;35:*.PPM=01;35:*.PNM=01;35:*.PCX=01;35:*.XBM=01;35:*.XPM=01;35:*.XCF=01;35:*.TIF=01;35:' 
+(eval):1> export LS_COLORS
+./globtest:2> setopt extendedglob
./globtest:3: no matches found: **/*.jpg

Script done on Mon Jul 25 20:44:13 2005



> Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
> 
> > Hmmm....my script now looks like this:
> > 
> >    #!/bin/zsh
> >    setopt extendedglob
> 
> As mentionned earlier on in the thread, this is not necessary anymore.
> 
> > 
> >    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)
> 
> Try running the script as:
> 
>   /bin/zsh -x script
> 
> And send us the result.  As Bart wrote, it might be some of your ~/.z*
> files messing up the cwd.
> 
> Phil.
> 


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

* Re: Command != command ???
  2005-07-25 18:53       ` Meino Christian Cramer
@ 2005-07-25 19:20         ` Philippe Troin
  2005-07-25 19:35           ` Meino Christian Cramer
  0 siblings, 1 reply; 23+ messages in thread
From: Philippe Troin @ 2005-07-25 19:20 UTC (permalink / raw)
  To: Meino Christian Cramer; +Cc: zsh-users

Meino Christian Cramer <Meino.Cramer@gmx.de> writes:

> From: Philippe Troin <phil@fifi.org>
> Subject: Re: Command != command ???
> Date: 25 Jul 2005 11:24:56 -0700
> 
> Thanks a lot for all your help ! ! !
> 
> My current "organisation" of my .z*-Files
> 
> I have split the .zshrc in files like:
> .zsh.options, .zsh.functions etc which all are
> sourced from .Zshrc like this
> 
> 		source $HOME/.zsh.options
> 
> I think, this is the same as if their script text would be a
> part of .zshrc itsself.
> 
> Any other file "works" the "normal way":
> 
> Furthermore, I stripped the script to just the suspicious lines, a
> dump of it can be found in the beginning of the following logfile (the
> symptoms are the same...I only removed some escape sequences from the
> PROMPT string, which otherwise would clutter the output.)
> 
> 
> Script started on Mon Jul 25 20:43:47 2005
> 
> cat ./globtest
> 
> 
> #!/bin/zsh
> setopt extendedglob
> print -l **/*.jpg
> 
> 
> 
> 
> /bin/zsh -x ./globtest

8< snip >8

Nothing suspicious here...

Do you have any .jpg files under the cwd? i.e., what does 

 find . "*.jpg"

say?

Phil.


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

* Re: Command != command ???
  2005-07-25 19:20         ` Philippe Troin
@ 2005-07-25 19:35           ` Meino Christian Cramer
  2005-07-25 22:37             ` Philippe Troin
  0 siblings, 1 reply; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-25 19:35 UTC (permalink / raw)
  To: phil; +Cc: zsh-users

From: Philippe Troin <phil@fifi.org>
Subject: Re: Command != command ???
Date: 25 Jul 2005 12:20:24 -0700

> Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
> 
> > From: Philippe Troin <phil@fifi.org>
> > Subject: Re: Command != command ???
> > Date: 25 Jul 2005 11:24:56 -0700
> > 
> > Thanks a lot for all your help ! ! !
> > 
> > My current "organisation" of my .z*-Files
> > 
> > I have split the .zshrc in files like:
> > .zsh.options, .zsh.functions etc which all are
> > sourced from .Zshrc like this
> > 
> > 		source $HOME/.zsh.options
> > 
> > I think, this is the same as if their script text would be a
> > part of .zshrc itsself.
> > 
> > Any other file "works" the "normal way":
> > 
> > Furthermore, I stripped the script to just the suspicious lines, a
> > dump of it can be found in the beginning of the following logfile (the
> > symptoms are the same...I only removed some escape sequences from the
> > PROMPT string, which otherwise would clutter the output.)
> > 
> > 
> > Script started on Mon Jul 25 20:43:47 2005
> > 
> > cat ./globtest
> > 
> > 
> > #!/bin/zsh
> > setopt extendedglob
> > print -l **/*.jpg
> > 
> > 
> > 
> > 
> > /bin/zsh -x ./globtest
> 
> 8< snip >8
> 
> Nothing suspicious here...
> 
> Do you have any .jpg files under the cwd? i.e., what does 
> 
>  find . "*.jpg"
> 
> say?
> 
> Phil.
> 

Under . there are directories containing jpgs, yes. 

Even

		print -l **/*.jpg

from the command line prints all of them.

The command

	   find . "*.jpg"

prints everything under . but

	   find . -name '*.jpg'

gives the same output as 

		print -l **/*.jpg

;)

Meino


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

* Re: Command != command ???
  2005-07-25 19:35           ` Meino Christian Cramer
@ 2005-07-25 22:37             ` Philippe Troin
  2005-07-26  0:33               ` Meino Christian Cramer
  0 siblings, 1 reply; 23+ messages in thread
From: Philippe Troin @ 2005-07-25 22:37 UTC (permalink / raw)
  To: Meino Christian Cramer; +Cc: zsh-users

Meino Christian Cramer <Meino.Cramer@gmx.de> writes:

> From: Philippe Troin <phil@fifi.org>
> Subject: Re: Command != command ???
> Date: 25 Jul 2005 12:20:24 -0700
> 
> > Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
> > 
> > > From: Philippe Troin <phil@fifi.org>
> > > Subject: Re: Command != command ???
> > > Date: 25 Jul 2005 11:24:56 -0700
> > > 
> > > Script started on Mon Jul 25 20:43:47 2005
> > > 
> > > cat ./globtest
> > > 
> > > 
> > > #!/bin/zsh
> > > setopt extendedglob
> > > print -l **/*.jpg
> > > 
> > > 
> > > 
> > > 
> > > /bin/zsh -x ./globtest
> > 
> > 8< snip >8
> > 
> > Nothing suspicious here...
> > 
> > Do you have any .jpg files under the cwd? i.e., what does 
> > 
> >  find . "*.jpg"
> > 
> > say?
> > 
> > Phil.
> > 
> 
> Under . there are directories containing jpgs, yes. 
> 
> Even
> 
> 		print -l **/*.jpg
> 
> from the command line prints all of them.
> 
> The command
> 
> 	   find . "*.jpg"
> 
> prints everything under . but
> 
> 	   find . -name '*.jpg'
> 
> gives the same output as 
> 
> 		print -l **/*.jpg

Mmh...

What about this script:

	#!/bin/zsh
	print "### pwd"
        pwd
        command pwd
	print "### find"
        find . -name "*.jpg"
        print "### glob"
        print -l **/*.jpg

What's the output?

Phil.


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

* Re: Command != command ???
  2005-07-25 22:37             ` Philippe Troin
@ 2005-07-26  0:33               ` Meino Christian Cramer
  2005-07-26  2:21                 ` Philippe Troin
                                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-26  0:33 UTC (permalink / raw)
  To: phil; +Cc: zsh-users

From: Philippe Troin <phil@fifi.org>
Subject: Re: Command != command ???
Date: 25 Jul 2005 15:37:42 -0700

> Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
> 
> > From: Philippe Troin <phil@fifi.org>
> > Subject: Re: Command != command ???
> > Date: 25 Jul 2005 12:20:24 -0700
> > 
> > > Meino Christian Cramer <Meino.Cramer@gmx.de> writes:
> > > 
> > > > From: Philippe Troin <phil@fifi.org>
> > > > Subject: Re: Command != command ???
> > > > Date: 25 Jul 2005 11:24:56 -0700
> > > > 
> > > > Script started on Mon Jul 25 20:43:47 2005
> > > > 
> > > > cat ./globtest
> > > > 
> > > > 
> > > > #!/bin/zsh
> > > > setopt extendedglob
> > > > print -l **/*.jpg
> > > > 
> > > > 
> > > > 
> > > > 
> > > > /bin/zsh -x ./globtest
> > > 
> > > 8< snip >8
> > > 
> > > Nothing suspicious here...
> > > 
> > > Do you have any .jpg files under the cwd? i.e., what does 
> > > 
> > >  find . "*.jpg"
> > > 
> > > say?
> > > 
> > > Phil.
> > > 
> > 
> > Under . there are directories containing jpgs, yes. 
> > 
> > Even
> > 
> > 		print -l **/*.jpg
> > 
> > from the command line prints all of them.
> > 
> > The command
> > 
> > 	   find . "*.jpg"
> > 
> > prints everything under . but
> > 
> > 	   find . -name '*.jpg'
> > 
> > gives the same output as 
> > 
> > 		print -l **/*.jpg
> 
> Mmh...
> 
> What about this script:
> 
> 	#!/bin/zsh
> 	print "### pwd"
>         pwd
>         command pwd
> 	print "### find"
>         find . -name "*.jpg"
>         print "### glob"
>         print -l **/*.jpg
> 
> What's the output?
> 
> Phil.
> 

It prints:

------------------------------------------------------------------
### pwd
/home/mccramer/data/pool10
/home/mccramer/data/pool10
### find
.
.
.
<print of the jpg-files>
.
.
.
### glob
------------------------------------------------------------------


The
"------------------------------------------------------------------"'s
are added by myself. After "### glob" there is following nothing
printed to stdout. To stderr there is the known error message:

		./globtest2:8: no matches found: **/*.jpg

(I called that script "globtest2"....)


Normally, in the root of the dirtree, where the jpgs are, there is no
jpg, but in the tree under the root there are jpgs (root ==
"/home/mccramer/data/pool10").

Now I did a 

	touch "test.jpg"

in the root and run the script again.
Now, this single fake jpg in the root was found by the glob pattern
'**/*.jpg'...but nothing else. 

By the way: What happens, when you run this script on your machine in
a similiar environment/ under similiar conditions, Phil? Does it work
for you ?

Meino


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

* Re: Command != command ???
  2005-07-26  0:33               ` Meino Christian Cramer
@ 2005-07-26  2:21                 ` Philippe Troin
  2005-07-26  4:20                 ` Sami Samhuri
                                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Philippe Troin @ 2005-07-26  2:21 UTC (permalink / raw)
  To: Meino Christian Cramer; +Cc: zsh-users

Meino Christian Cramer <Meino.Cramer@gmx.de> writes:

> From: Philippe Troin <phil@fifi.org>
> Subject: Re: Command != command ???
> Date: 25 Jul 2005 15:37:42 -0700
> 
> > What about this script:
> > 
> > 	#!/bin/zsh
> > 	print "### pwd"
> >         pwd
> >         command pwd
> > 	print "### find"
> >         find . -name "*.jpg"
> >         print "### glob"
> >         print -l **/*.jpg
> > 
> > What's the output?
> > 
> > Phil.
> > 
> 
> It prints:
> 
> ------------------------------------------------------------------
> ### pwd
> /home/mccramer/data/pool10
> /home/mccramer/data/pool10
> ### find
> .
> .
> .
> <print of the jpg-files>
> .
> .
> .
> ### glob
> ------------------------------------------------------------------
> 
> 
> The
> "------------------------------------------------------------------"'s
> are added by myself. After "### glob" there is following nothing
> printed to stdout. To stderr there is the known error message:
> 
> 		./globtest2:8: no matches found: **/*.jpg
> 
> (I called that script "globtest2"....)
> 
> 
> Normally, in the root of the dirtree, where the jpgs are, there is no
> jpg, but in the tree under the root there are jpgs (root ==
> "/home/mccramer/data/pool10").
> 
> Now I did a 
> 
> 	touch "test.jpg"
> 
> in the root and run the script again.
> Now, this single fake jpg in the root was found by the glob pattern
> '**/*.jpg'...but nothing else. 

What zsh version (print $ZSH_VERSION)?
Can you run an strace on the script (strace globtest2)?
What does 'print -l **/*' say?
 
> By the way: What happens, when you run this script on your machine in
> a similiar environment/ under similiar conditions, Phil? Does it work
> for you ?

Yes, no problems...

Phil.


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

* Re: Command != command ???
  2005-07-26  0:33               ` Meino Christian Cramer
  2005-07-26  2:21                 ` Philippe Troin
@ 2005-07-26  4:20                 ` Sami Samhuri
  2005-07-27 18:25                   ` Meino Christian Cramer
  2005-07-26  5:07                 ` Bart Schaefer
  2005-07-26 10:28                 ` Peter Stephenson
  3 siblings, 1 reply; 23+ messages in thread
From: Sami Samhuri @ 2005-07-26  4:20 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]

* On Tue Jul-26-2005 at 02:33:19 AM +0200, Meino Christian Cramer said:
> 
> 		./globtest2:8: no matches found: **/*.jpg
[...]
> Normally, in the root of the dirtree, where the jpgs are, there is no
> jpg, but in the tree under the root there are jpgs (root ==
> "/home/mccramer/data/pool10").
> 
> Now I did a 
> 
> 	touch "test.jpg"
> 
> in the root and run the script again.
> Now, this single fake jpg in the root was found by the glob pattern
> '**/*.jpg'...but nothing else. 

What are the names of the directories? More specifically, do they start
with a "."?

~ % mkdir -p jpegs/.dir{1..5}
~ % cd jpegs
~/jpegs % for i ({1..5})
for> touch .dir$i/pic{1..3}.jpg
~/jpegs % find . -name '*.jpg'
./.dir1/pic1.jpg
./.dir1/pic2.jpg
./.dir1/pic3.jpg
./.dir2/pic1.jpg
./.dir2/pic2.jpg
./.dir2/pic3.jpg
./.dir3/pic1.jpg
./.dir3/pic2.jpg
./.dir3/pic3.jpg
./.dir4/pic1.jpg
./.dir4/pic2.jpg
./.dir4/pic3.jpg
./.dir5/pic1.jpg
./.dir5/pic2.jpg
./.dir5/pic3.jpg
~/jpegs % print -l **/*.jpg
zsh: no matches found: **/*.jpg

-- 
Sami Samhuri

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Command != command ???
  2005-07-26  0:33               ` Meino Christian Cramer
  2005-07-26  2:21                 ` Philippe Troin
  2005-07-26  4:20                 ` Sami Samhuri
@ 2005-07-26  5:07                 ` Bart Schaefer
  2005-07-27  2:50                   ` Meino Christian Cramer
  2005-07-26 10:28                 ` Peter Stephenson
  3 siblings, 1 reply; 23+ messages in thread
From: Bart Schaefer @ 2005-07-26  5:07 UTC (permalink / raw)
  To: zsh-users

Philippe and Meino, would you please trim off some of each other's
previous postings before appending new stuff to the end?  It's not
necessary to include the entire thread so far, expecially when
you're often adding very little new text.

On Jul 26,  2:33am, Meino Christian Cramer wrote:
}
} ### find
} .
} .
} .
} <print of the jpg-files>
} .
} .
} .
} ### glob

Please show us at least a couple of the actual paths printed by "find".
You may be concealing a critical bit of information.

} Now I did a 
} 
} 	touch "test.jpg"
} 
} in the root and run the script again.
} Now, this single fake jpg in the root was found by the glob pattern
} '**/*.jpg'...but nothing else. 

What happens if you use

    print **/*.jpg(D)

in the script?


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

* Re: Command != command ???
  2005-07-26  0:33               ` Meino Christian Cramer
                                   ` (2 preceding siblings ...)
  2005-07-26  5:07                 ` Bart Schaefer
@ 2005-07-26 10:28                 ` Peter Stephenson
  3 siblings, 0 replies; 23+ messages in thread
From: Peter Stephenson @ 2005-07-26 10:28 UTC (permalink / raw)
  To: zsh-users

Meino Christian Cramer wrote:
> From: Philippe Troin <phil@fifi.org>
> > What about this script:
> > 
> > 	#!/bin/zsh
> > 	print "### pwd"
> >         pwd
> >         command pwd
> > 	print "### find"
> >         find . -name "*.jpg"
> >         print "### glob"
> >         print -l **/*.jpg
> > 
> > What's the output?
> > 
> > Phil.
> > 
> 
> It prints:
> 
> ------------------------------------------------------------------
> ### pwd
> /home/mccramer/data/pool10
> /home/mccramer/data/pool10
> ### find
> .
> .
> .
> <print of the jpg-files>
> .
> .
> .
> ### glob
> ------------------------------------------------------------------
> 
> 
> The
> "------------------------------------------------------------------"'s
> are added by myself. After "### glob" there is following nothing
> printed to stdout. To stderr there is the known error message:
> 
> 		./globtest2:8: no matches found: **/*.jpg

Make sure you have an up-to-date zsh.  There were one or two bugs in
pattern matching that got fixed earlier this year to do with character
counting and termination.

If it's still happening, it may be there is a file with non-ASCII
characters which is still confusing zsh: lots of such problems have been
fixed but it won't surprise me if some are left.  It would be useful to
narrow the problem down to a particular set of files or directory
subtree.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: Command != command ???
  2005-07-26  5:07                 ` Bart Schaefer
@ 2005-07-27  2:50                   ` Meino Christian Cramer
  0 siblings, 0 replies; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-27  2:50 UTC (permalink / raw)
  To: schaefer; +Cc: zsh-users

From: Bart Schaefer <schaefer@brasslantern.com>
Subject: Re: Command != command ???
Date: Tue, 26 Jul 2005 05:07:57 +0000

Hi all,

 Philippe has found the problem ! TADA! :)

 As previuosly mentioned, I have to set extendedglob either in .zshenv
 or the script itsself. But this wasn't the "missing link...

 One has to add setopt globdots also, since my directories were 
 of the form .<dirname>

 Thanks you all for the help!
 Meino

 

> Philippe and Meino, would you please trim off some of each other's
> previous postings before appending new stuff to the end?  It's not
> necessary to include the entire thread so far, expecially when
> you're often adding very little new text.


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

* Re: Command != command ???
  2005-07-26  4:20                 ` Sami Samhuri
@ 2005-07-27 18:25                   ` Meino Christian Cramer
  0 siblings, 0 replies; 23+ messages in thread
From: Meino Christian Cramer @ 2005-07-27 18:25 UTC (permalink / raw)
  To: sami; +Cc: zsh-users

From: Sami Samhuri <sami@no-eff-eks.com>
Subject: Re: Command != command ???
Date: Mon, 25 Jul 2005 21:20:15 -0700

> * On Tue Jul-26-2005 at 02:33:19 AM +0200, Meino Christian Cramer said:
> > 
> > 		./globtest2:8: no matches found: **/*.jpg
> [...]
> > Normally, in the root of the dirtree, where the jpgs are, there is no
> > jpg, but in the tree under the root there are jpgs (root ==
> > "/home/mccramer/data/pool10").
> > 
> > Now I did a 
> > 
> > 	touch "test.jpg"
> > 
> > in the root and run the script again.
> > Now, this single fake jpg in the root was found by the glob pattern
> > '**/*.jpg'...but nothing else. 
> 
> What are the names of the directories? More specifically, do they start
> with a "."?
> 
> ~ % mkdir -p jpegs/.dir{1..5}
> ~ % cd jpegs
> ~/jpegs % for i ({1..5})
> for> touch .dir$i/pic{1..3}.jpg
> ~/jpegs % find . -name '*.jpg'
> ./.dir1/pic1.jpg
> ./.dir1/pic2.jpg
> ./.dir1/pic3.jpg
> ./.dir2/pic1.jpg
> ./.dir2/pic2.jpg
> ./.dir2/pic3.jpg
> ./.dir3/pic1.jpg
> ./.dir3/pic2.jpg
> ./.dir3/pic3.jpg
> ./.dir4/pic1.jpg
> ./.dir4/pic2.jpg
> ./.dir4/pic3.jpg
> ./.dir5/pic1.jpg
> ./.dir5/pic2.jpg
> ./.dir5/pic3.jpg
> ~/jpegs % print -l **/*.jpg
> zsh: no matches found: **/*.jpg
> 
> -- 
> Sami Samhuri

Exactly, the "." was the problem! Philippe found that, too :)

Thank you all for your help ! :))

Keep zshing!
Meino



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

end of thread, other threads:[~2005-07-27 18:24 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-24  5:42 Command != command ??? Meino Christian Cramer
2005-07-24 22:12 ` Philippe Troin
2005-07-24 23:22   ` Bart Schaefer
2005-07-25  3:06   ` Meino Christian Cramer
2005-07-25  3:32     ` Philippe Troin
2005-07-25  3:45       ` Meino Christian Cramer
2005-07-25  4:14         ` Philippe Troin
2005-07-25 16:06           ` Meino Christian Cramer
2005-07-25  3:54       ` Bart Schaefer
2005-07-25  4:15         ` Philippe Troin
2005-07-25 18:00   ` Meino Christian Cramer
2005-07-25 18:24     ` Philippe Troin
2005-07-25 18:53       ` Meino Christian Cramer
2005-07-25 19:20         ` Philippe Troin
2005-07-25 19:35           ` Meino Christian Cramer
2005-07-25 22:37             ` Philippe Troin
2005-07-26  0:33               ` Meino Christian Cramer
2005-07-26  2:21                 ` Philippe Troin
2005-07-26  4:20                 ` Sami Samhuri
2005-07-27 18:25                   ` Meino Christian Cramer
2005-07-26  5:07                 ` Bart Schaefer
2005-07-27  2:50                   ` Meino Christian Cramer
2005-07-26 10:28                 ` Peter Stephenson

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).