1828617 Members
7974 Online
109983 Solutions
New Discussion

Command substitution

 
Kevin.Wang
Frequent Advisor

Command substitution

#TEST=$(DATE)
#echo $TEST
Mon Jul 21 13:23:59 EAT 2003
#set
........
TEST='Mon Jul 21 13:23:59 EAT 2003'
TZ=EAT-8
_=2003

how to delete VAR TEST when i execute set?
14 REPLIES 14
Tim Adamson_1
Honored Contributor

Re: Command substitution

Hi,

Try the unset command

unset TEST

Cheers!
Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.
Con O'Kelly
Honored Contributor

Re: Command substitution

Hi

You can use
# unset
eg
# unset VAR.

Cheers
Con
Rajeev  Shukla
Honored Contributor

Re: Command substitution

use
#unset

to unset the vaiable

Rajeev
Con O'Kelly
Honored Contributor

Re: Command substitution

Hi

You can use the unset command.
# unset
eg
# unset TEST

Cheers
Con
Radim Jarosek
Regular Advisor

Re: Command substitution

Hi,

try this :

# unset TEST


HTH

Radim
twang
Honored Contributor

Re: Command substitution

Use "unset TEST" in your script.
nibble
Super Advisor

Re: Command substitution

try this

# unset TEST

Caesar_3
Esteemed Contributor

Re: Command substitution

Hello Kevin!

What you need to do in shell is:
unset TEST

(unset )

Good luck.

Caesar
John Meissner
Esteemed Contributor

Re: Command substitution

you can use:

unset test

to unset a variable. you don't really need to unset this variable unless you are going to have your script read for this variable again. Basically by this I mean if you have your script do something and print the date along with your action.... and want the action to repeat... but with the current date printed each time with it.

you can also unset multiple variables at the same time if you wish to.

unset test1 test2 test3

regards
All paths lead to destiny
Malleron Mathieu
Frequent Advisor

Re: Command substitution

omg you are doing that only for get some points ....
John Collier
Esteemed Contributor

Re: Command substitution

Malleron,

I don???t know about you, but I don???t see that post as being nothing more than an attempt to get some points. I personally feel that John was simply expanding on the issue above and beyond what the previous replies revealed. I know that there is a high possibility that some new ???Sys Admin in Training??? may very well be helped by the additional information provided as they search the forums for answers and/or knowledge.

Even if I am incorrect in my thoughts, I am personally more appalled at your attempt to slam a person publicly for any reason.

This is supposed to be a professional forum with professional people. Personally, I don???t feel that you are exhibiting very professional behavior when you make comments like that about other forumers.

That is, of course, just my own personal thoughts on the subject.


Have a nice day???


PS. I am not expecting, nor do I want, any points for this post. Please assign it a 0 (zero).
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
Pete Randall
Outstanding Contributor

Re: Command substitution

John,

You're seeing the cleaned up version of this thread. I don't even remember who it was but somebody had replied like 20 times and gotten 10 points for each one. And it was obvious that they weren't a "stuck submit key" syndrom, either, because there were other answers interspersed.

That's what the reference was about.


Pete


Pete
John Collier
Esteemed Contributor

Re: Command substitution

If that is truly the case, then I retract my statement.

I can only comment on what I see when I arrive, not what was there that I have never seen.

Please forgive me???
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
John Meissner
Esteemed Contributor

Re: Command substitution

unset etc....

unset test

this can be done for multiple variable at the same time.

regards,
All paths lead to destiny