procmail
[Top] [All Lists]

=| and newlines

2001-08-28 06:50:37
This is probably an FAQ, but I cannot find the answer.

Apparently, =| embeds any newlines that occur in the command into the
variable.  For example,

:0
FOO=|echo 4 \* 5 | bc

lets FOO have a newline as the last character in it.

The question is: how can I chop/strip/delete/remove/get rid of the newline
before I use it later?

For example,

:0
BAR=|sed -e 's/XXX/'$FOO'/'

later in the script will fail due to the embedded new-line.

(I cannot use `command` (backticks) because I need to check the return
status of the command.)

Bash is my shell.  Perhaps there's a bash way to do this?

Please cc me on any responses since I no longer subscribe to this list.

Thanks.

-- 
Robert Brown, Programmer/Sys Admin |                http://www.TopicalNet.com
mailto:robertb(_at_)topicalnet(_dot_)com      |                      99.9% 
dolphin-free!
voice: 781-932-8400 x100           |         800 West Cummings Park, Ste 2900
fax: 781-932-2558                  |                    Woburn, MA 01801-6351

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>