Problem with new linux server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem with new linux server
# 1  
Old 12-11-2008
Problem with new linux server

Hi all,

We have migrated from a unix solaris server to a linux server. When we run the same pieces of code, they are behaving very differently. Some of the problems I am facing are -

cat filename | read var1 var2
echo "var1 var2"

works in unix, but returns null values in linux.

Similarly, I am not getting any results when I give the 'compress' command. It gives me an error saying "compress not found".

This is impacting a lot of the legacy code. So, is there any way I can enlist the differences at once and go and fix all of it instead of having to fix them one by one when they fail?

Thanks for your time!
# 2  
Old 12-11-2008
Quote:
Originally Posted by novice1324
Hi all,

We have migrated from a unix solaris server to a linux server. When we run the same pieces of code, they are behaving very differently. Some of the problems I am facing are -

cat filename | read var1 var2
echo "var1 var2"
works in unix, but returns null values in linux.
interesting.... what do you on Solaris?
First, echo have
Code:
echo "var1 var2"

where you probably meant:
Code:
echo "${var1} ${var2}"

besides the above, this will not return anything as you're PIPING to 'read' which creates a subshell which exits after the 'read' is done and your var1/var2 vanish as well.
Quote:
Originally Posted by novice1324

Similarly, I am not getting any results when I give the 'compress' command. It gives me an error saying "compress not found".
Your $PATH env var probably does not include the directory where 'compress' resides on linux (if it's installed at all).
Quote:
Originally Posted by novice1324

This is impacting a lot of the legacy code. So, is there any way I can enlist the differences at once and go and fix all of it instead of having to fix them one by one when they fail?

Thanks for your time!
Take a look at this OS comparison chart, but your problems are much more shell fundamental....
# 3  
Old 12-11-2008
There are alot differences in syntax and commands when going from Unix to Linux or vise versa.

That compairison chart is helpfull, thanks...
# 4  
Old 12-11-2008
Thank you Vgersh99!!

My apologies. I meant $var1 and $var2.

About creation of a subshell, is this behavior specific to linux? I didnt have this problem before. Or is there something I can do to mitigate these differences (as you mentioned that they are shell fundamental)?
# 5  
Old 12-11-2008
Quote:
Originally Posted by novice1324
Thank you Vgersh99!!

My apologies. I meant $var1 and $var2.

About creation of a subshell, is this behavior specific to linux? I didnt have this problem before. Or is there something I can do to mitigate these differences (as you mentioned that they are shell fundamental)?
No, this is a fundamental shell behavior - irrespective of the OS.
As I said, what you quoted for reading a pipped input to 'read' does not work on Sun/Solaris' ksh.
An alternate paradigm is the following:
Code:
$ cat /tmp/aaa
aaa bbb
$ read a b < /tmp/aaa
$ echo "[$a] [$b]"
[aaa] [bbb]
$

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Problem in accessing Oracle Database Server from Linux Machine

I am facing a strange issue in connecting to Oracle database from Linux Machine - The connectivity is not failing all the time , the failure to success ratio is 1:70. - Error "ORA-12545: Connect failed because target host or object does not exist" - Majority of the time the connection... (6 Replies)
Discussion started by: balaji kumar
6 Replies

2. Homework & Coursework Questions

Configure the AD Window server with Linux server(google Authenticator is installed)

Hi my name is Manju. ->I have configure the two way authentication on my linux server. ->Now I am able to apply two way authenticator on particuler user. ->Now I want to map this linux server to my AD server. ->Kindly tell me how to map AD(Active Directory) with this linux server. ... (2 Replies)
Discussion started by: manjusharma128
2 Replies

3. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

4. Programming

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning. The script is called cwrmail.pl and is located in my cgi-bin. When I... (9 Replies)
Discussion started by: BigBobbyB
9 Replies

5. Emergency UNIX and Linux Support

Help with Ubuntu Linux Server Password Problem...

Hi all, I have no root access enabled on our linux server due to safety issues. We use sudo. When I change my password using passwd command, I sometimes get issues where I can't log back in. Pam_Tally disables due to trying my password too many times. So someone in my group has to reset... (7 Replies)
Discussion started by: zixzix01
7 Replies

6. Linux

Red Hat linux(Advance server) problem

we are receiving following error in our application server & server not booted:- "INIT IP ID x ,Respawning too fast; disable for 5 minutes." Please give me solution for above mention problem as early as possible . AKM (3 Replies)
Discussion started by: akm9999
3 Replies

7. Red Hat

redhat linux mail server problem

we are using redhat linux,configured the postfix as mail server and outlook is used as mail client.whenever the user opens outlook it is start downloading all the mails from the server. Example : If a user has 50 mails in the server,whenever he opens the outlook the outlook will start... (0 Replies)
Discussion started by: ramjimh2k3
0 Replies

8. Linux

ftp problem from linux to windows2000 server

Hi All, I was trying to ftp multiple files from my windows to my linux box, everything gets transfered but unfortunately some of them are corrupted. I found out that some of the files are in Ascii and some are binary, but since most of the files I'm trying to send are Ascii...the big ones... (2 Replies)
Discussion started by: 3rr0r_3rr0r
2 Replies

9. UNIX for Dummies Questions & Answers

Problem to ping Linux server

I want to access window file system through Samba. when i ping Window machine through linux machine it connect, but in reverse case it shows "Request time out". could any one suggest what problem may be. (1 Reply)
Discussion started by: sonirajesh
1 Replies

10. UNIX for Dummies Questions & Answers

DNS Name Server Problem on Linux

I'm very new to all of this, so I apologize in advance if my post comes off incoherent, or terms aren't used correctly :rolleyes: Using Fedora Core 2, I set up am internal DNS name server. After setting up the named.conf, and the localhost files I was able to correctly resolve my host name... (3 Replies)
Discussion started by: skeet23
3 Replies
Login or Register to Ask a Question