greetings all,
I am have a heck of a time trying to accomplish a very simple thing. I have an array of "shortname<spaces>id" created from a dscl output. I want to assign shortname=word1 and id=word2. I have tried
shortname=$(${textArray[$i]} | awk '{print $1}') - and get 'awk : cannot open file - and the prints word 1.
e.g. awk : cannot open file johnsmith
Using the syntax >>echo ${textArray[$i]} | awk '{print $1}' << I can see it is finding the data correctly as it displays the shortname from the array.
Any suggestions for what I know is something really obvious that I have missed would be greatly appreciated.
thanks