missing arguments for script functions
Is this supposed to work?
function f() {
set x="$1"
set y="$2"
echo "${x} ${y}"
}
f "a" "b"
f "c" "d"
In my testing the positional arguments are not provided to f(). At least when the code above is loaded via 'configfile "${var}"'.
Olaf
Quoted 3 lines · Olaf Hering
Is this supposed to work?
function
f(){
This gives syntax error to me. But
function f {
echo $1
}
works.
Quoted 18 lines
set x="$1"
set y="$2"echo "${x} ${y}"
}f "a" "b"
f "c" "d"In my testing the positional arguments are not provided to
f(). At least when the code above is loaded via 'configfile "${var}"'.Olaf
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 5 lines · Andrei Borzenkov
Quoted 3 lines · Olaf Hering
Is this supposed to work?
function
f(){
Quoted 7 lines
This gives syntax error to me. But
function f {
echo $1
}works.
It does. Not sure what exactly was used in my first attempt which caused the errors. At least now it is working as expected.
Olaf