Regarding Set command

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding Set command

Ayush
Hi Nabble,

Thanks for making such a wonderful and useful website.

I just want to know more about set command with it's all parameter with example.

e.g. set -a 

 Can you please help me on that
Regards,
Ayush kabra
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Set command

Guru
Administrator
set -a exports all the subsequently defined variables automatically.  From the man page of ksh:

-a
sets all subsequently defined variables for export.


guru@unixschool:~$ x=20
guru@unixschool:~$ env | grep -w x
guru@unixschool:~$ set -a
guru@unixschool:~$ y=30
guru@unixschool:~$ env | grep -w y
y=30
guru@unixschool:~$