Re: sedding away but chmod don't like...]
From: Matt M (mattm_inet_at_yahoo.com)
Date: 10/16/03
- Next message: R.B: "fuser problem"
- Previous message: Peter Bunclark: "Re: Solaris 9 on Blade 1500"
- In reply to: Ronald van Zantvoort: "Re: sedding away but chmod don't like...]"
- Next in thread: Ronald van Zantvoort: "Re: sedding away but chmod don't like...]"
- Reply: Ronald van Zantvoort: "Re: sedding away but chmod don't like...]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 16 Oct 2003 16:49:46 +0700
Ronald van Zantvoort wrote:
> Matt M wrote:
> >
> > Ronald van Zantvoort wrote:
> > > However. If I type:
> > > chmod 777 "/dir1/dir2/file with spaces" it has no problem.
> > >
> > > The output of the script at that point is (for example):
> > >
> > > chmod: WARNING: can't access "/dir1/dir2/test/"
> > > chmod: WARNING: can't access "/dir1/dir2/space
> > > chmod: WARNING: can't access test/"
> >
> > Perhaps you need to use eval?
> >
> > eval chmod 777 [script output]
> >
> > Matt M
>
> Right.......
> That seems to work like a dream, THANK YOU! (Though you have me puzzled
> more than ever)
Glad it works. The gurus in comp.unix.shell can give you an exhaustive
answer as to why, but basically it boils down to the shell's rules for
evaluating commands. ksh usually removes quotes from commands, but not if
they are quoted, and not if they result from a previous expansion. In your
case, ksh isn't removing the quotes because they result from expanding the
command subsititution (the part between backticks). Hence the problems with
chmod. eval gets round this problem by causing the shell to evaluate the
command line twice - first to create the arguments to eval, and second to
evaluate the resulting command (at which point the quotes are removed). If
you're using a recent version of ksh93, you can get more information with:
$ eval --man
Matt M
- Next message: R.B: "fuser problem"
- Previous message: Peter Bunclark: "Re: Solaris 9 on Blade 1500"
- In reply to: Ronald van Zantvoort: "Re: sedding away but chmod don't like...]"
- Next in thread: Ronald van Zantvoort: "Re: sedding away but chmod don't like...]"
- Reply: Ronald van Zantvoort: "Re: sedding away but chmod don't like...]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|