read the files in side the folder 'test' and print the content of each file into other folder in the same directory lets say(testresult) with the same file name and .sql extension.
file1.sql(extension is .sql).
file2.sql
file3.sql
...
...
filen.sql
ls -l .txt | while read file; do awk '{if(NR==1)
{
t=$1;
$1=""
s="ALTER TABLE ADD COLUMN " t" "$0
next;
}
s=s" ,"$0
}
END {
print s" ) " }' $file*. ; done
awk: cmd. line:12: fatal: cannot open file `-rwxrwxrwx' for reading (No such file or directory)
awk: cmd. line:12: fatal: cannot open file `-rwxrwxrwx' for reading (No such file or directory)
i want to execute the awk command functionality during each file reading but it seems it does work for me ..any idea about the error?
Regards