Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt
file4.txt
I want all the *.txt do the same command like:
awk '{print $1"\t"}'
My desired output is got a script named as txt.sh look like this:
awk '{print $1"\t"}' file1.txt
awk '{print $1"\t"}' file2.txt
awk '{print $1"\t"}' file3.txt
awk '{print $1"\t"}' file4.txt
The way I do now is :
ls *.txt | awk '{print "awk \"{$_\"\\t\"}\"",$1}'
And the output I get is like this:
awk "{print $1"\t"}" file1.txt
awk "{print $1"\t"}" file2.txt
awk "{print $1"\t"}" file3.txt
awk "{print $1"\t"}" file4.txt
If I type something like:
ls *.txt | awk '{print "awk \'{$_\"\\t\"}\'",$1}'
It is not worked at all.
Thus I'm asking whether you know the way to express the single quote by awk print to get my desired output result
thanks again for all of your suggestion