Migs
Migs

Reputation: 1480

Unset Command in Linux does not clear the Variable

I am trying to unset a variable in Linux, but the unset command isn't working.

[jisip@slc10xxx plsql]$ echo $PERL5LIB
/net/slcnasxxx.in.ecalor.com/export/xxx/bin
[jisip@slc10xxx plsql]$ unset PERL5LIB
[jisip@slc10xxx plsql]$ echo $PERL5LIB
/net/slcnasxxx.in.ecalor.com/export/xxx/bin

Any ideas or alternatives?

Upvotes: 2

Views: 506

Answers (1)

Migs
Migs

Reputation: 1480

I was able to resolve this by using unsetenv instead of unset.

[jisip@slc10xxx plsql]$ unsetenv PERL5LIB
[jisip@slc10xxx plsql]$ echo $PERL5LIB                                                                                                                                                                   
PERL5LIB: Undefined variable.
[jisip@slc10xxx plsql]$ 

Hope this helps out!

Upvotes: 2

Related Questions