Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '"option" not found' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
"option" not found
Authored by: logo on Mar 18, '03 04:16:47AM

>> echo \"Usage: `basename $0` <option>\";

Remove the backslashes!

Currently you echoing " and then issuing the command with read input (<) from option...
and not an echo of the string containing "...<option>"

HTH



[ Reply to This | # ]
"option" not found
Authored by: mervTormel on Mar 18, '03 12:37:44PM

it's a little more complicated than that.

basename can take an argument, and if $0 is -bash (interactive bash shell), then basename gaks on the -switch.

so, pass basename the -- switch so that it stops processing arguments...

echo "Usage: `basename -- $0` <option>";

this works on the command line; you may need to quote it up some for your shell/script



[ Reply to This | # ]