Reputation: 9752
I have something like:
cut -d ' ' -f2 | xargs cat *VAR_HERE.ss
where I want to use the result of cut as a variable and concat the output of cut between *
and .
so that cat will use the name to output the appropriate file. for example if the result of cut is:
$ cut -d ' ' -f2
001
I essentially want the second command to do:
$ cat *001.txt
I have seen xargs been used, but I am struggling to find out how to use it to explicitly call the output of cut, rather than assuming the second command only requires the exact output. obviously here I want to concat the output of cut to a string.
thanks
Upvotes: 3
Views: 3090