bash query
James Takac
p3nndrag0n at gmail.com
Sun Jun 3 13:37:15 UTC 2007
On Sunday 03 June 2007 19:23:34 Andy wrote:
> On 03/06/07, dave selby <dave6502 at googlemail.com> wrote:
> > #!/bin/bash
> > read KEY
> > if [ $KEY = "q" ];
> > then
> > echo "a QQQQQQQQQQQQQQQ"
> > fi
> > [snip]
> > dave at dev-machine:~$ ./test.sh
> >
> > ./test.sh: line 5: [: =: unary operator expected
> > dave at dev-machine:~$
>
> Use "$KEY" instead of $KEY , that way if $KEY has no value it
> evaluates to the empty string ""
>
>
>
> --
> First they ignore you
> then they laugh at you
> then they fight you
> then you win.
> - Mohandas Gandhi
Hi Guys
Thought I'd ask here re something I'm trying to do as it kinda relates to the
subject. Anyone know if you can pipe a command to a terminal session in a
script? I'm hoping for the script to open a terminal, pipe a command to it,
then when finished close the terminal window
James
More information about the ubuntu-users
mailing list