1753432 Members
4756 Online
108793 Solutions
New Discussion юеВ

Re: 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