Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"--" option to bourne shell

Status
Not open for further replies.

CarlK

Programmer
Dec 15, 2000
3
US
Howdy.

I'm trying to run a bourne shell script that runs fine on other
machines, but when run on HP gives the message "A specified
flag is not valid for this command." The flag on the shebang
line giving the grief is "--".

The general bourne-shell help file for that option (off the web) reads:
-- Does not change any of the flags. This is useful in setting the $1
positional parameter to a string beginning with a - (dash).

Why is this not a valid flag on HP-UX? Or am I missing something?

Further details given below; *any* help much appreciated.

Carl



System info for the machine I'm running on: HP-UX B.11.00 U 9000/800

After experimenting a bit, the following file exhibits the problem:

#!/bin/sh -- -f
echo "OK..."

So does:

#!/bin/sh -- # A comment
echo "OK..."

But this seems to run fine:

#!/bin/sh --
echo "OK..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top