I'm trying to output the contents of the infile to the outfile using Append.
I will want to use append but the syntax doesn't seem to be working !
Input file (called a.txt) contains this:
a
a
a
b
b
b
I'm running shell script (called k.sh) from Unix command-line like this:
./k.sh . a.txt
#!/usr/bin/sh
infile="$1/$2"
awk '{print $0 >> newfile.txt}' $infile
Error on command-line:
syntax error The source line is 1.
The error context is
{print $0 >> >>> newfile. <<< txt}
awk: The statement cannot be correctly parsed.
The source line is 1.