Quote:
Originally Posted by ust
I have a script "my_script" to echo file to it as below,
$vi my_script
echo "abc" > file
echo "def" > file
The output is as below
===============
abc
def
|
No, this will result in a file which will contain "def". As the previous poster said, each time you use > the file is reinitialized, unless you use >> instead, to append.
Quote:
Now I want the output as below , there are 5 space between the word "abc" and "def" , can advise what can i do ? thx
I want the output as below
==================
$vi file
abc def
|
[/quote]
Quote the strings adequately.
Code:
echo "abc def" > myfile
You can as well use cat << EOF to put whole blocks of text
Code:
cat << EOF
this
is my
custom tale
EOF > myfile