PDA

View Full Version : [ubuntu] use echo!!!



ra2008
July 23rd, 2008, 05:53 PM
Hi,
i am trying to create new file using "echo" and write in a new line. what i do is:

$echo -e 1 \n 2 >> test

what i get inside test:
1 n 2
any hint?

Xerp
July 23rd, 2008, 05:56 PM
Not all versions of echo permit backslash escape codes.



echo "one line" > file
echo "new line" >> file

Cypher
July 23rd, 2008, 06:15 PM
You need to put the expression in quotes to properly evaulated. So change your line to


echo -e "1\n2" > test
cat test