#@!?£$# stdout problem!!
I'm very new to shell scripting, and I need to append stdout to a file. I do this using
command >> file this works fine, except that I want the data to be appended on the same line, with no space in between the existing data and the new data, for example, if stdout contains "", and tempfile contains "31", i get: 13 37 when i want 1337 :cool: :D any ideas on how to do this (or maybe format a file so that everything is on 1 line??) please help!!!! thankyou. :newbie: :newbie: :newbie: |
sorry, im my example, stdout should contain "37", tempfile should contain "13"
see im such a newbie i dont even know hwo to pyte propre;y yet |
Re: #@!?£$# stdout problem!!
Quote:
If you were using `echo' to do this, you could do the following: $ echo -e "13\c" > /tmp/temp.file $ echo "37" >> /tmp/temp.file $ cat /tmp/temp.file 1337 $ You can also use `echo -n' in linux but the `\c' special character is recognized by other UNIX shells without needing a special switch. Six of one... Hope this helps... Have fun. |
echo -n "31" > /tmp/temp.file
echo "337" >> /tmp/temp.file |
All times are GMT -5. The time now is 02:59 PM. |