I may have this function in a bash script that gets sourced to the shell
function suman{
echo "using suman function"
}
if I call
unset suman
things seem to work as expected
however if I have this as my function:
function suman-inspect {
echo "using suman-inspect function"
}
then if I call
unset suman-inspect
or
unset "suman-inspect"
I get this message:
bash: unset: `suman-inspect': not a valid identifier
How can unset this variable as is?
After some more research, it appears that
unset -f "suman-inspect"
will work. This is surprising because unset suman
did work, and did successfully unset the suman function (as far as I could tell).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With