Re: Bash commands
Mark Zimmerman wrote:
>
> On Sun, Sep 01, 2002 at 02:25:53PM +1000, Russell wrote:
> > Russell wrote:
> > >
> > > Hi,
> > >
> > > When i try a command like:
> > >
> > > debpc:# if [ -n df /mnt | grep -ie "/dev/hdc1" ] echo "yes"
> > >
> > > then after i press "return", i get a command prompt ">" which
> > > seems to be waiting for more input. Why does that happen?
> >
> > sorry, i missed out some things. I think the promp > happens when
> > the statement is unfinished (no "fi"). Should be:
> >
> > debpc:# if [ -n df /mnt | grep -ie "/dev/hdc1" ] ; then echo "yes" ; fi
> >
> > However, this gives the error:
> > [: missing ']'
> > grep: ]: No such file or directory
> >
>
> if [ -n $(df /mnt | grep -ie "/dev/hdc1") ] ; then echo "yes" ; fi
Hi, unfortunately, it gives "yes" when i do:
debpc:# if [ -n $(df /mnt | grep -ie "/dev/crap") ] ; then echo "yes" ; fi
When i try
debpc:# $(df /mnt | grep -ie "/dev/hdc1")
i get
bash: /dev/hdc1: Permission denied
Reply to: