Lets say I have a directory that has the following files:
thing_one
thing_two
thing_three
I want to get an array of the second field if each file name is split on the underscore in csh. I have to use csh. Ex. one two three. I get the correct printout by using the following:
Is | awk -F_ '{ print $2 }
But, I want to assign the output to a variable. I tried using:
set output = "`ls | awk -F_ '{ print $2 }'`"
But, if I echo output
, I get an array with thing_one thing_two thing_three
. What am I missing? It's like the awk
is being skipped.