The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cannot telnet/ftp to solaris machine by straight cable makes problem .. mahadib SUN Solaris 7 09-17-2008 06:50 AM
how to transfer a file from unix to window machine balireddy_77 Shell Programming and Scripting 3 10-12-2007 04:44 AM
How to unzip a file ftped from Window box? terala_s UNIX for Advanced & Expert Users 10 06-24-2007 02:38 PM
how can I copy a file from unix to window machine? fredao UNIX for Advanced & Expert Users 6 12-04-2006 11:18 PM
runnig script from window machine sjumma UNIX for Dummies Questions & Answers 2 06-21-2006 01:16 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-22-2008
Raj Kumar Arora Raj Kumar Arora is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 10
strange problem regarding zip/unzip from window to solaris machine

Hi ,

I faced a very strange problem when I unzip a zip file on my solaris workstation. Actually I wanted to transfer a folder, say it TEST which contains some sub-folders inside it from windows to solaris machine. So I zipped this folder to TEST.ZIP on my windows machine.

Then from my windows machine, I started ftp from command prompt and connected to my solaris machine and I copied this TEST.ZIP folder using put command to my solaris mahcine in bin mode.

On my solaris machine, I extracted this folder by following command :-
$ unzip TEST.ZIP
It unzipped the folder and produced a TEST folder. But the problem is that when I opened any file from any of the sub-folders of this TEST folder using vi editor, in every line it is showing "^M" i.e., control + M character which I dont intended.

Firstly I could not know how these control chars are getting appended. But when I searched on google for solving the problem, I could only find the reason but not its solution. The reason for these control char is that in window every line is terminated by Enter or Return key which in solaris mahcine appeared as these control chars.

Anybody who have any idea, please help me ASAP.

Regards,
Raj Kumar Arora
  #2 (permalink)  
Old 01-22-2008
sparcguy sparcguy is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Posts: 315
that one will always happen.

on yur solaris machine just run dos2unix, check yur man pages how to run

or

vi file

:%s/^M//g <--- enter
  #3 (permalink)  
Old 01-22-2008
Raj Kumar Arora Raj Kumar Arora is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 10
Quote:
Originally Posted by sparcguy View Post
that one will always happen.

on yur solaris machine just run dos2unix, check yur man pages how to run

or

vi file

:%s/^M//g <--- enter
The later option does not worked for me showing the error message "Searched pattern match failed". The first option dos2unix is working but its suitable for only some of the files or only few files as for it the source file name and target file name should be different. So I tried to firstly cp/mv all file like this mv *.cc *.cc.old
or cp *.cc *.cc.old
which failed because the cp or mv command failed for * wildcard. I cant manually change for each file as I am having a bunch of files.

Any alternative ?

Regards,
Raj Kumar Arora
  #4 (permalink)  
Old 01-22-2008
moofoo moofoo is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 14
the ^ refers to the beginning of a line wenn using the sed so you have to mask it like \^M so the correct vi / sed command should look like

:%s/\^M//g


cheers
  #5 (permalink)  
Old 01-23-2008
Raj Kumar Arora Raj Kumar Arora is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 10
Quote:
Originally Posted by moofoo View Post
the ^ refers to the beginning of a line wenn using the sed so you have to mask it like \^M so the correct vi / sed command should look like

:%s/\^M//g


cheers
Sorry to say that even this doesnt work. Also when I also tried to find out
only ^M in file by typing /^M enter; then that too didnt worked out.

The reason is that it pertains combination of the two chars ^ and M as a single char and not two different chars. I came to known this conclusion by deleting the char ( using x key in escape mode). It needs to press only one time the x key for deleting this combination of these two chars.

Regards,
Raj Kumar Arora
  #6 (permalink)  
Old 01-23-2008
sparcguy sparcguy is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Posts: 315
:%s/^M//g will work in vi mode

I told u to vi the file right?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0