Bash Scripting - Functions
Given this script snippet:
What will be the output and why?
function greet {
echo "Hello, $1"
}
name="Alice"
greet $nameWhat will be the output and why?
function greet {
echo "Hello, $1"
}
name="Alice"
greet $name$name are expanded before the function call, so greet $name becomes greet Alice.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions