Re: sedding away but chmod don't like...]

From: Matt M (mattm_inet_at_yahoo.com)
Date: 10/16/03


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



Relevant Pages

  • Re: Access CommandButton "On Click" property
    ... Dim cnt As DAO.Container ... > each command button in the design view of the form, ... Matt ... > write the value of their Click event properties to a table. ...
    (microsoft.public.access.macros)
  • Re: SCP problem
    ... > Matt Bostock enlightened us with: ... > you tell 'scp' to copy a directory. ... The second command tells scp to copy ... > The problem with the world is stupidity. ...
    (alt.os.linux)
  • Re: Limiting the cells a command button can change
    ... "Matt" wrote in message ... I would like to limit the cells that the command button can ... I would like to say that if the activecell is within a range, ... the code so that the button is limited to a certain range of cells. ...
    (microsoft.public.excel.programming)
  • Re: ERROR [07002] [MySQL][
    ... > Command at design time. ... Matt... ... Just wondering - have you tried out the ByteFX data provider for MySQL? ... It is the standard data provider in the Mono distribution and it works ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ERROR [07002] [MySQL][
    ... > Command at design time. ... Matt... ... Just wondering - have you tried out the ByteFX data provider for MySQL? ... It is the standard data provider in the Mono distribution and it works ...
    (microsoft.public.dotnet.languages.vb)