I have a function in my shell script that takes options. It works fine, until I try to pass '-n' option, then the function cannot read the arg.
func ()
{
for arg in "$@"
do
echo $arg
done
}
func -p #works
func -e #works
func -n #doesn't work, func cannot read arg
Anyone has an idea of why this is happening?
Tried: passing multiple options to the function, they all work, except '-n'. Expect: read '-n' as an argument in my function.