Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I have a small problem, please look next code and output, and could you tell me what I miss. #!/bin/bash
foo () { echo "Parameter #1 is $1" } foo
my output: [user@host]$ ./test.scr test
Parameter #1 is
functions get their own positional parameters from when they are called.
If you need to pass the scripts arguments to the function use foo "$@" (the quotes are important do not forget them).
foo "$@"
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.