Hi,
Can someone tell what is the path for "unset", I tried "which" command but getting below error
# which unset
/usr/bin/which: no unset in (/usr/lib/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin/:/root/bin)
Hi,
Can someone tell what is the path for "unset", I tried "which" command but getting below error
# which unset
/usr/bin/which: no unset in (/usr/lib/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin/:/root/bin)
Hi,
on Debian Linux + Bash:
type unset
unset is a shell builtin
Yes, it's a shell built-in, much like set is.
$ type set
set is a special builtin
$ type unset
unset is a special builtin
(ksh on Solaris)
It alters values inside the shell itself, so it pretty much has to be a builtin. So does cd. (There is sometimes a cd utility too, but it's used for other purposes.)
The standards require that "standard utilities" have to be available as stand-alone utilities so you do things like:
find dir -exec utility arg... \;
The only utilities defined by the standards that are excluded from this requirement are the special built-ins: break , colon , continue , dot (i.e., . ), eval , exec , exit , export , readonly , return , set , shift , times , trap , and unset .
And, before you say it doesn't make any sense to use cd in a find -exec primary, the command:
find dir ! -exec cd {} \;
is a simple way to get the names of inaccessible directories in the file hierarchy rooted in the directory named dir .
what is difference between
env -u TEST
and
unset TEST
when I run "env -u TEST" and do "env|grep TEST", get "TEST=tesvalue"
when I run "unset TEST", didn't any o/p for "env|grep TEST" command.
env creates a new environment, unsets the TEST variable in it, and runs whatever command you gave it in that new environment.
Since you gave it no command, that new environment immediately quits without doing anything else, leaving you back in your original one.
then what is the exact command to unset TEST, I don't want to run "unset TEST". Run "env -u TEST" and it has to remove "TEST=testenv"
You discovered it earlier in this topic, and proved to yourself that it works for your purposes:
...so I am unsure what else you need at this point.
apologies. I got the difference .