LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-04-2010, 09:35 AM   #1
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
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...

Last edited by vinaytp; 02-04-2010 at 09:36 AM.
 
Old 02-04-2010, 09:47 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,245

Rep: Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431
Quote:
Originally Posted by vinaytp View Post
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?
 
Old 02-04-2010, 10:04 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by TB0ne View Post
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...
 
Old 02-04-2010, 11:14 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,245

Rep: Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431
Quote:
Originally Posted by vinaytp View Post
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.
 
Old 02-04-2010, 11:39 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to give inline comment at variable declaration in Makefile w/o including space..? mayankmehta83 Linux - Newbie 6 12-07-2009 05:33 AM
Shell scripting : how to name a variable with the value of another variable JimOrJoe Programming 9 06-15-2008 10:36 PM
Need to extract name of C variable from C declaration. judgex Programming 3 09-22-2007 01:46 PM
Using Flex and Bison to parse the variable declaration section in Pascal unreal07 Programming 1 03-10-2007 09:25 PM
Help with variable assigning in shell scripts fultron Linux - Newbie 2 02-16-2007 05:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration