Re: Command substitution failure - why?

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

 



On Sun, 14 Nov 2004 15:56:33 -0600 (CST)
Vidiot <brown@xxxxxxxxxxxxxxxxxx> 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?

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux