Quote:
Originally Posted by Ashish Sood
try this
echo filename1>filename2
|
No. That would make the file called filename2 consist of a single line of text, that text being "filename1" (minus the quotes). That is, it echoes the file's
name, not the file's
contents.
You could use cat instead: cat filename1 > filename2
If you insist on using echo, then you'll need to loop through each line of the first file. For example:
Code:
while read -r line
do
echo "$line" >> filename2
done < filename1