View Single Post
  #3   (View Single Post)  
Old 21st May 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Quote:
Originally Posted by coppermine View Post
The shell is complaining about usage of -ne operator usage in if statement.
Post that line (adding a '# this is the line' comment to it would be nice) and about 4 or 5 lines above down to the closing statement, e.g. a matching 'fi' to the 'if' line, usually it is indented to the same level.

Also post the entire error output and any other relivent output from the script.

Pasting the entire script content to pastebin for a months time or as an attachment might not hurt either.


EDIT:

I do learn new things every now and then that I didn't know were valid Bourne, but generally get along fine with /bin/sh.


Quote:
Originally Posted by coppermine View Post
That's strange - opensource community, but has not the same scripting language!

FreeBSDs /bin/sh implementation is more focused on POSIX (i.e. the standard) then on extending the language. Look up the Almquist shell.


The Bourne Again SHell (bash) is the standard GNU shell and equivalent to /bin/sh in the GNU operating system. The funky Linux/GNU symbiosis makes them bed-fellows when it comes to a shell. Although some Distros are using the Debian Almquist shell (dash) instead of bash; baiscally a port of NetBSD's sh to Linux.


BourneAgain is a superset of Bourne which means Bourne script will run in bash but BourneAgain script (and Korn script in both cases) will not run in a Bourne shell if it uses BASH (or Korn) specific features.


I write scripts strictly with a POSIX Bourne Sell in mind and beyond what it provides, usually tells me that I need to use a bigger scripting language.


Although I must admit, I have recently considered writing for Korn instead of Bourne... But then using my scripts on Linux boxes could get more iffy :|
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.

Last edited by TerryP; 21st May 2008 at 10:41 PM.
Reply With Quote