Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Corruption when transfer Solaris file to Linux 1

Status
Not open for further replies.

toddyl

Technical User
Sep 26, 2005
102
US
Hi,

I'm trying to gather various information about my servers and have put together a perl script to do this. One of the things I'm interested in is CPU information. Early on I check if the system is Solaris or Linux and run the appropriate commands. On Solaris I am running kstat -m cpu_info. My process runs in such a way that the output is sent to a file on a Linux server:

ssh mySolarisServer /apps/runScript.pl > output

My problem is that when I run this script I am seeing corruption (lots of ^@ symbols) after the text I'm looking for from the Solaris machines.

I logged into my Solaris server and ran:

kstat -m cpu_info > output

The output seemed fine so I then used scp to transfer the file to the Linux box. However when I do this I am seeing the same corruption in the output file on the Linux server.

Does anyone have any idea why this is and what can I do (in Perl) to fix this.

Thanks,

Tom
 
What is in your profile on the Solaris server? Is it enforcing any terminal settings perhaps? Try renaming your .profile (or whichever one is appropriate for your choice of shell) temporarily to disable it on the Solaris server and see if that makes any difference.

Annihilannic.
 
I've tried what you said (am using a cshrc file) but it made no difference :-(
 
Oh, okay, I just checked and it seems that it's just a 'feature' of the kstat -m cpu_info output. For example, if you do a kstat -m cpu_info | cat -vet on your Solaris box you will see the same characters. They seem to be null characters, so try doing

[tt]ssh hostname 'kstat -m cpu_info | tr -d "\0"'[/tt]

Annihilannic.
 
Annihilannic,

Your a star. That worked perfectly.

Thanks for your help.

Toddyl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top