Re: Problem with bash linux

From: William Park (opengeometry_at_yahoo.ca)
Date: 10/17/03


Date: 17 Oct 2003 19:48:26 GMT

Macigno <dcollina@dianoema.it> wrote:
> I need help:
> i have a shell that works properly on Unix Aix. I have to make it work
> on Linux Red Hat Server.
> My problem is:
>
> if (-f ./*.OK) then .....
>
> But the line (-f ./*.OK) doesn't work. I receive the error "?too many
> arguments". If i write (-f ./???.OK) which would be good for me) i
> receive the error "?binary operator expected".
> Thank you for your help.

Wrong syntax for Bourne shells (ie. Bash, Sh, Ash, Ksh). Also, you'll
have problem when there are more than 1 file. Try something like
    if ls *.OK > /dev/null; then ...; fi

-- 
William Park, Open Geometry Consulting, <opengeometry@yahoo.ca>
Linux solution for data management and processing. 


Relevant Pages

  • Re: Why newbies dont RTFM...
    ... Even though I've used Linux before, I've never had to do any ... > BASH BUILTIN COMMANDS ... > last command exited within ... > unless the shell is not exeâ ...
    (comp.os.linux.misc)
  • Why newbies dont RTFM...
    ... Even though I've used Linux before, I've never had to do any ... BASH BUILTIN COMMANDS ... last command exited within ... unless the shell is not exeâ ...
    (comp.os.linux.misc)
  • Re: [opensuse] deleting
    ... during the installation of jre 1.5.0 (according to the install ... i'm learning and having fun with my new toy, the command line interface. ... understand and use linux more efficiently. ... /bin/sh is the Bourne Shell. ...
    (SuSE)
  • Re: [opensuse] Future of SUSE (at home)
    ... BTW if you really want to make your windows stuff "just work" in linux, ... but you persist in saying "it can't be done". ... and you don't always need a shell. ...
    (SuSE)
  • Re: Dude, wheres my network?
    ... > Mac does it too, of course, but most apps in Linux are amenable to the PNC ... SMIT also had an option to show you the low level commands it used so ... I opened a shell and typed man sys-unconfig and there it was. ... > window, ...
    (comp.unix.solaris)