D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Sed experts wanted, perhaps?

 

On 19/04/13 21:36, Grant Phillips-Sewell wrote:
>
> #!/bin/sh
> # Send Twitter updates through Twidge
> command="twidge update"
> status="$@"
> $command $status

"#" is only special to the shell it is fine inside a variable.

How are you invoking this.

If

myscript "fred #barney" it should work

If

myscript fred #barney

Then the invoking shell will strip of the "#barney" before it runs your
script, so you can't fix your script to show "#barney" as it is not
available to it.

Thus

while read a ; do myscript $a ; done <tweets
or
while read a ; do myscript "$a" ; done <tweets

Will probably work fine, since the "#"s are only in the input not in the
script.

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq