Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Why doesn't echo $1 doesn't print $1 in this simple bash script?
echo $1
$1
#!/bin/bash # function.sh print_something () { echo $1 } print_something $ ./function.sh 123 -> why doesdoesn't notit print '123' as a result?
Why echo $1 doesn't print $1 in this simple bash script?
#!/bin/bash # function.sh print_something () { echo $1 } print_something $ ./function.sh 123 -> why does not print '123' as result?
Why doesn't echo $1 print $1 in this simple bash script?
#!/bin/bash # function.sh print_something () { echo $1 } print_something $ ./function.sh 123 -> why doesn't it print '123' as a result?