Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!mcsun!unido!quando!omerzu From: omerzu@quando.quantum.de (Thomas Omerzu) Newsgroups: comp.unix.questions Subject: Re: sed/csh interaction Message-ID: <1677@quando.quantum.de> Date: 23 Aug 90 08:31:58 GMT References: <1311@eastman.UUCP> Reply-To: omerzu@quando.quantum.de (Thomas Omerzu) Organization: Quantum GmbH, Dortmund, W-Germany Lines: 49 In article <1311@eastman.UUCP> gerwitz@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@quando.uucp Quantum GmbH, Bitnet: UNIDO!quando!omerzu / omerzu%quando@UNIDO(.bitnet) Dortmund, Germany Internet: omerzu@quando.quantum.de