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

Justin Rebelo justin.rebelo at gmail.com
Tue May 1 09:49:47 PDT 2007


pw wrote:
> 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

man bash
search for "--"



More information about the Discuss mailing list