[Discuss] How to keep '-' in bash args

pw p.willis at telus.net
Tue May 1 09:48:01 PDT 2007


Hello,

Can anyone tell me how to ensure (sh flags ??) that
bash doesn't strip '-' from the front end of
arguments passed to a shell script?

ie: sh script.sh  -myarg

#!/bin/bash
#script.sh
echo "$1"


returns:
myarg instead of -myarg
                  ^


Peter



More information about the Discuss mailing list