bash passing positional parameters in function -
i have small problem, please next code , output, , tell me miss. #!/bin/bash
foo () { echo "parameter #1 $1" } foo
my output: [user@host]$ ./test.scr test
parameter #1
parameter #1
functions own positional parameters when called.
if need pass scripts arguments function use foo "$@"
(the quotes important not forget them).
Comments
Post a Comment