473,408 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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
Jan 22 '08 #1
6 5750
ashitpro
542 Expert 512MB
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
When you copy files from windows to linux/unix. Carriage returns get appended at each line.
Use "dos2unix" command. Don't worry it will definitely work.
Jan 22 '08 #2
When you copy files from windows to linux/unix. Carriage returns get appended at each line.
Use "dos2unix" command. Don't worry it will definitely work.
Thanks a lot.The 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
Jan 23 '08 #3
ashitpro
542 Expert 512MB
Thanks a lot.The 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
Syntax for dos2unix is something like below

dos2unix <filename>

It has no source-destination issue.
you supply one file and it will be converted thats it.
You can use dos2unix as-

$ find . -type f -exec dos2unix {} \;

It will work recursively
But make sure that your files are text files.
because this command may corrupt your binaries.
Jan 23 '08 #4
Syntax for dos2unix is something like below

dos2unix <filename>

It has no source-destination issue.
you supply one file and it will be converted thats it.
You can use dos2unix as-

$ find . -type f -exec dos2unix {} \;

It will work recursively
But make sure that your files are text files.
because this command may corrupt your binaries.
The first option is working only if we provide source and target filename both. I tried it as you said but with single argument that didnt worked. Also the second option is never terminating.
Jan 23 '08 #5
ashitpro
542 Expert 512MB
The first option is working only if we provide source and target filename both. I tried it as you said but with single argument that didnt worked. Also the second option is never terminating.
Hmm

I think dos2unix works on solaris with different way..
any way
try this one.

find . -type f -print | xargs -I {} dos2unix -ascii {} {}

remember after find there is DOT(.)
let me know if it works
Jan 23 '08 #6
Hmm

I think dos2unix works on solaris with different way..
any way
try this one.

find . -type f -print | xargs -I {} dos2unix -ascii {} {}

remember after find there is DOT(.)
let me know if it works
Thanks. It worked for me. I really appreciate your efforts and heartly thankful to you for solving my problem and also to thescripts.com forums. It really works!!!!

One question I would like to ask is the mechanism behind this. I know the find command but I am tring to under stand this whole command.

Regards,
Raj Kumar Arora
Jan 23 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Putz Ronald | last post by:
Hy! We got the same datamodell on Solaris and on WindowsXP. But there is a mojor difference in the Performance. The database on Windows is much faster than the one on Solaris although the...
0
by: renniw one | last post by:
Hi, I have been trying to compile mysql on a solaris 8 machine. However, I am getting internal compiler errors. What compiler and version did anyone use to successfully compile mysql on a solaris...
4
by: Uthuras | last post by:
Greetings All, I have situation as such that I need to access the DB2 database reside on a Solaris box. I have DB2 6.1 on my Solaris box. However, my webserver is on Redhat 7.2. Now, I want to...
25
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
6
by: invincible | last post by:
Hi I have program void main() { #ifdef env_var printf(" I am in Linux"); #endif }
8
by: ReeseDog | last post by:
I have a AIX backup of DB2 (8.2) and i was told i needed to have a unix OS installed to be able to restore this database. So now i have installed Solaris 10 (x86 hardware). I copied the DB2.tar...
8
by: WhiteWizard | last post by:
Have we got a STRANGE one going here. We converted from 1.1 to 2.0 about 2 weeks ago and this has been a problem since then...but only on SOME machines in our development group. The application...
1
by: jayakumarrt | last post by:
Dear Friends, Can anybody tell me how to run perl script using apache server in solaris machine? I have apache installed in Solaris machine.Server is remote server.I am trying to run the...
2
by: somsub | last post by:
Hi all, Here is my samle code use strict ; use warnings ; use IO::Uncompress::Unzip ; When I compiled this three lines of code in win32 I got error like below.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.