PDA

View Full Version : bash: how to remove the return char in an output


Cyrus
January 7th, 2006, 09:14 PM
Hi,

when I am using a shell program it returns its output always with a carriage return. I want to remove this, because I am piping everything into a textfile, where no return should be. A simple example:

echo hallo >> test
echo hallo >> test

The file test looks now like this:

hallo
hallo

I need:

hallohallo

Maybe cut helps?

echo hallo | cut ... >> test

cylon359
January 7th, 2006, 09:17 PM
echo -n hallo >> test

Cyrus
January 10th, 2006, 02:02 PM
Works just great, thanks alot!