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
# 8  
Old 01-23-2008
The ^M that you are talking about here are not two characters. Its actually a control character. Use 'ctrl-V ctrl-M' to get the actual character. Try this in vi:

:%s/ctrl-Vctrl-M//g
# 9  
Old 01-23-2008
you could try following command.
dos2unix -ascii -437 <YOUR FILENAME> <YOUR FILENAME>

above command will convert your file from dosformatted text to UNIX one.
-ascii will tell command to use ascii charset and -437 to use US keyboard.

If there are multiple text files in your TEST directory then you could try following command

find . -type f -exec -- 'dos2unix -ascii -437' {} {} \;
# 10  
Old 01-23-2008
Quote:
Originally Posted by blowtorch
The ^M that you are talking about here are not two characters. Its actually a control character. Use 'ctrl-V ctrl-M' to get the actual character. Try this in vi:

:%s/ctrl-Vctrl-M//g
Thanks. It worked for me. I really appreciate your efforts and heartly thankful to you for solving my problem and also to unix.com forums. It really works.

One more thing at last, by this way I need to open all the files which may be in same sub-folders for changing all files. IS there any way to operate it or dos2unix command for all files in the same folder and in sub-folders in
one command action.

Regards,
Raj Kumar Arora
# 11  
Old 01-23-2008
Quote:
Originally Posted by neerajrathi2
you could try following command.
dos2unix -ascii -437 <YOUR FILENAME> <YOUR FILENAME>

above command will convert your file from dosformatted text to UNIX one.
-ascii will tell command to use ascii charset and -437 to use US keyboard.

If there are multiple text files in your TEST directory then you could try following command

find . -type f -exec -- 'dos2unix -ascii -437' {} {} \;
thanks neeraj,
but sorry to say that the later option of using find command is not working. And moreover the problem with first option is that I need to dos2unix each file . I mean I cant change all files of even same type by using following command:-
dos2unix -ascii -43 *.cc

Although dos2unix -ascii -43 test1.cc test1.cc is working.

Any other details in this regard which may prove helpful to me?

Regards,
Raj Kumar Arora

Last edited by Raj Kumar Arora; 01-23-2008 at 05:03 AM..
# 12  
Old 01-23-2008
Quote:
Originally Posted by Raj Kumar Arora
thanks neeraj,
but sorry to say that the later option of using find command is not working. And moreover the problem with first option is that I need to dos2unix each file . I mean I cant change all files of even same type by using following command:-
dos2unix -ascii -43 *.cc

Although dos2unix -ascii -43 test1.cc test1.cc is working.

Any other details in this regard which may prove helpful to me?

Regards,
Raj Kumar Arora
Thanks to all of you who have take your time again. I got my problem solved in the way I was looking for, i.e., a single command worked for me which did the dos/window to unix format transformation in a single command for all the files in a folder and sub-folders.
It is find . -type f -print | xargs -I {} dos2unix -ascii {} {}

Cheers !!!!

Regards,
Raj Kumar Arora
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