LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Variable Declaration in shell scripts... (https://www.linuxquestions.org/questions/linux-newbie-8/variable-declaration-in-shell-scripts-786966/)

vinaytp 02-04-2010 08:35 AM

Variable Declaration in shell scripts...
 
Hi all..

We have a file that declares many environmental variables. Out of which I have doubt on few. These variables are declared in UNIX environment. We are planing to migrate them along with applications to Linux.

Code:

export MAILSERVER="%new@hub"
MAIL_USERS="vinay.new"{MAILSERVER}",vijay.new"{MAILSERVER}

Does the above declarations work in Linux ?

The above declarations expands to
Code:

mail vinay.new%new@hub,vijay.new%new@hub
which looks little wierd.

I normally use vinay.linux.com being the mail server
Code:

mail vinay.new@vinay.linux.com,vijay.new@vinay.linux.com
This perfectly works fine

Thanks in advance...

TB0ne 02-04-2010 08:47 AM

Quote:

Originally Posted by vinaytp (Post 3852347)
Hi all..

We have a file that declares many environmental variables. Out of which I have doubt on few. These variables are declared in UNIX environment. We are planing to migrate them along with applications to Linux.

Code:

export MAILSERVER="%new@hub"
MAIL_USERS="vinay.new"{MAILSERVER}",vijay.new"{MAILSERVER}

Does the above declarations work in Linux ?

Well, have you TRIED IT?? Also, what language are you writing this in?? Just bash/shell script, or something else?

vinaytp 02-04-2010 09:04 AM

Quote:

Originally Posted by TB0ne (Post 3852366)
Well, have you TRIED IT?? Also, what language are you writing this in?? Just bash/shell script, or something else?

It just uses k shell in Unix. SO we are porting all our applications to K shell in Linux..These are just k shell scripts.

Still Analisation phase is going, Not did not got a chance to try. will this work in Linux ?

Can you please suggest...
Thanks...

TB0ne 02-04-2010 10:14 AM

Quote:

Originally Posted by vinaytp (Post 3852400)
It just uses k shell in Unix. SO we are porting all our applications to K shell in Linux..These are just k shell scripts.

Still Analisation phase is going, Not did not got a chance to try. will this work in Linux ?

Can you please suggest...

Yes...I suggest you try it.

ksh should function the same, but the only way to know is to actually do it.

catkin 02-04-2010 10:39 AM

When you try it you can see what the shell is doing by turning tracing on with set -xv (turn off with set +xv)


All times are GMT -5. The time now is 11:08 PM.