You are not logged in.
I want to define and call a function without saving it for later. Is this possible in bash?
If not, can anyone think of a way to write it?
Offline
function foo {
echo "doing foo stuff"
}
foo arg1 arg2 arg3
unset -f foo
# now foo is no longer defined
Offline
And to get a more lambda-like feel:
eval "function foo { echo 'doing foo stuff'; }"
foo
unset -f foo
Offline