RE: [SLUG] sh sed problem

From: Bill Glidden (bglidden@tampabay.rr.com)
Date: Tue Jan 20 2004 - 10:41:00 EST


Change to :

BLAH=`echo "$1" | sed 's/.*\\\//'`

My linux box is down, but that works on Solaris.

> -----Original Message-----
> From: slug@nks.net [mailto:slug@nks.net] On Behalf Of Backward Thinker
> Sent: Tuesday, January 20, 2004 9:49 AM
> To: slug@nks.net
> Cc: slug@nks.net
> Subject: Re: [SLUG] sh sed problem
>
>
> >> here's my test.sh:
> >>
> >> #!/bin/sh
> >> BLAH= echo "$1" | sed 's/.*\\//'
> >> echo $BLAH
> >> BLAH= ` echo "$1" | sed 's/.*\\//' `
> >> echo $BLAH
> >>
> >> if I call ./test.sh 'blah\blah' I see:
> >> blah
> >>
> >> sed: -e expression #1, char 7: Unterminated `s' command
> >>
> >>
> >> In neither case is BLAH getting set to anything useful. The first
> >> case is because the output is going to stdout, but in the second
> >> case, I thought BLAH would get set? It's the same sed comand, but
> >> with this usage I get an error? Help?
>
> > You need to put the expression in backticks.
> > BLAH=`echo something`
>
> The second one was in backticks, but I get unterminated `s' command.
>
> ~ Daniel
>
> ________________________________________________________________
> The best thing to hit the internet in years - Juno SpeedBand!
> Surf the web up to FIVE TIMES FASTER!
> Only $14.95/ month - visit www.juno.com to sign up today!
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:26:24 EDT