using awk on a variable

Ray Parrish crp at
Thu Jan 21 13:46:49 UTC 2010


I have the following code which is not working -

          ReturnValue="`ls -als "$Package"`"
          if [[ "$ReturnValue" != "" ]]
                    DateTime="`awk "$ReturnValue" { print $7, $8 }`"
                    echo "$DateTime"

The error returned is as follows -

awk: 592 -rwxr-xr-x 1 root root 601056 2009-01-29 04:51 gedit
awk:             ^ syntax error

I imagine that somehow I am passing the variable to awk incorrectly. I 
need the 7th, and 8th arguments of the string
variable $ReturnValue, and it will contain the string shown in the error 
message above.

Can someone please enlighten me as to the proper way of doing this?

Thanks, Ray Parrish

Linux dpkg Software Report script set..
Ray's Links, a variety of links to usefull things, and articles by Ray.
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.

More information about the ubuntu-users mailing list