sed/csh interaction

Thomas Omerzu omerzu at quando.quantum.de
Thu Aug 23 18:31:58 AEST 1990


In article <1311 at eastman.UUCP> gerwitz at hpcore.kodak.com (Paul Gerwitz) writes:

|question is "why won't this one script work on both machines.

|works on Decstation 3100 @ Ultrix 3.0
|DOES NOT WORK on HP835 at HP-UX 7.0
|
|#!/bin/csh -f
|# Command to print stdin with a Subject: line
|set title=`tee temporary | sed -e '/^Subject: /\\!d\\\
| s/Subject: //'`
| echo $title

|Works on HP-UX
|DOES NOT WORK on Ultrix
|
|#!/bin/csh -f
|set title="`tee temporary | sed -e '/^Subject: /\\!d \\
| s/Subject: //'`"
|echo $title


Well, _both_ scripts won't work on SUNs;
I tested SUN OS 3.3, 3.5 and 4.0.3.

Obviously some sed's don't like commands being seperated the
way you do it, and there seem to be different ways for
various csh's to interpret lots of backslashes at the end of a line.


The following script uses ';' to seperate
sed-commands and will work on HP-UX as well as Ultrix and SUN-OS:


#!/bin/csh -f
# Command to print stdin with a Subject: line
set title=`tee temporary | sed -e '/^Subject: /\\!d;s/Subject: //'`
echo $title





-- 
*-----------------------------------------------------------------------------*
Thomas Omerzu      UUCP:     ...!unido!quando!omerzu / omerzu at quando.uucp
  Quantum GmbH,    Bitnet:   UNIDO!quando!omerzu / omerzu%quando at UNIDO(.bitnet)
Dortmund, Germany  Internet: omerzu at quando.quantum.de



More information about the Comp.unix.questions mailing list