[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Command substitution failure - why?



On Sun, 14 Nov 2004 15:56:33 -0600 (CST)
Vidiot <brown mrvideo vidiot com> wrote:

> I'm using zsh/
> 
> When I enter the following on the command line, I get the expected
> result:
> 
> 	echo ann001.jpg | awk "{ print substr(\$0, 1, length(\$0) -7 )
> 	}"
> 
> Expect result = ann
> 
> But, when I do this:
> 
> 	OUT=`echo ann001.jpg | awk "{ print substr(\$0, 1, length(\$0)-	-7 ) }"`
> 
> I get back nothing.  The variable is empty.
> 
> Anyone have an idea as to why the aboce isn't working?

Have you tried:

    export OUT=`echo ann001.jpg | awk "{ print substr(\$0, 1,length(\$0) -7 ) }"`

and then looked to see what the variable reads?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]