strange problem regarding zip/unzip from window to solaris machine


 
Thread Tools Search this Thread
Operating Systems Solaris strange problem regarding zip/unzip from window to solaris machine
# 1  
Old 01-22-2008
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  
Old 01-22-2008
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  
Old 01-22-2008
Quote:
Originally Posted by sparcguy
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  
Old 01-22-2008
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  
Old 01-23-2008
Quote:
Originally Posted by moofoo
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  
Old 01-23-2008
:%s/^M//g will work in vi mode

I told u to vi the file right?
# 7  
Old 01-23-2008
Quote:
Originally Posted by sparcguy
:%s/^M//g will work in vi mode

I told u to vi the file right?
Yes you are right. But I too was right because I tried it after opening the file with vi editor .
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

.zip unzip alternative

Hi, I have some .zip files which contain in them files that are > 2G in size. I am using unzip command to extract the files. Files contained in the .zip that are < 2G are not having any problem but those that are > 2G gives me this error: error: invalid compressed data to inflate What... (2 Replies)
Discussion started by: wong.Raymond
2 Replies

2. Shell Programming and Scripting

Unzip the .zip file without using unzip utility in UNIX

I have .zip file, i want to list all the files archived in the zip file. unzip utility is not working for me in unix. Please help me resolve this issue Thanks ganesh. (3 Replies)
Discussion started by: Ganesh L
3 Replies

3. Shell Programming and Scripting

How to Unzip a file using unzip utility for files zipped without zip utility ?

Hi, I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server. How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies

4. Shell Programming and Scripting

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

5. Shell Programming and Scripting

Get zip path from unzip -l

I am listing the contents of a zip file and then grepping for a specific string ie: filename.a to get a line like: 309753 10-18-08 15:20 etc/filename.a The etc/filename.a is the path the file is at within the zip file...how might I capture this path as I want to use that path to unzip that... (2 Replies)
Discussion started by: phreezr
2 Replies

6. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

7. HP-UX

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

8. Shell Programming and Scripting

zip and unzip

Hi all , How to create a zip file and how to unzip the files . i just want to zip selected files from a directory ... Regards, Dhananjay (2 Replies)
Discussion started by: dhananjayk
2 Replies

9. UNIX for Dummies Questions & Answers

Can solaris's Zip/Unzip handle Winzip Version 10.0 Files?

I understand that this version of Winzip allows 129-bit AES encryption and passwords. Can Solaris handle that yet? (2 Replies)
Discussion started by: BCarlson
2 Replies

10. UNIX for Advanced & Expert Users

How to unzip a .zip file when

there is no unzip package present. (2 Replies)
Discussion started by: yogesh_powar
2 Replies
Login or Register to Ask a Question