Hi,
I've got a folder with several files I'd like to manipulate. The file names are all ending in .txt and I'd like to loop through their names for manipulation. This is the script I've got so far:
for i in 'ls *.gtc.txt|cut -d "." -f1';
do
echo${i};
done
It should be easy enough, but the result looks like this:
ls
file1.gtc.txt
file2.gtc.txt
file3.gtc.txt
|
cut
-d
"."
-f1
I've also tried this:
for i in 'ls *.txt|cut -d "." -f1';
do
awk '{print $1,$2,$3,$4,$7$8,$9,$10}' ${i}.gtc.txt > ${i};
done
but the error I'm getting is this:
line 3: ${i}: ambiguous redirect
any ideas? what am I doing wrong?
Many thanks in advance!