Hi
I am trying to store the output of awk into a variable in a shell script. I can run it successfully from the command line but not from a ksh shell script.
ls -al test.txt | grep -v grep | awk '{print $1}'
returns -rw-r--r--
#!/bin/ksh
perm=$(`ls -al test.txt | grep -v grep | awk '{print $1}'`)
echo $perm
returns ./test.sh[2]: -rw-r--r--: not found
Could you please tell me what I am doing wrong.
Thanks
Mace