- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- transferring binary from windows to hpux
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 11:18 AM
01-29-2006 11:18 AM
When an ascii file is transferred to hpux; sometime i have seen ^M characters at the end of the line on hpux.
If binary file is transferred via ftp in bin mode from windows to hpux then do i need to take care of anything ?
Thanks,
Shiv
Solved! Go to Solution.
- Tags:
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 11:35 AM
01-29-2006 11:35 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 11:53 AM
01-29-2006 11:53 AM
Re: transferring binary from windows to hpux
is binary also different ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 11:54 AM
01-29-2006 11:54 AM
Re: transferring binary from windows to hpux
is binary also different ?
If no; then how come binary files has been made platform independent ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 11:56 AM
01-29-2006 11:56 AM
Re: transferring binary from windows to hpux
THe "^M" character you see is the graphic representation of a carriage-return character.
Unix uses a newline (linefeed) character to denote the end of a line. Windows uses a linefeed plus carriage return couplet to do the same.
When you specify an ASCII mode FTP transfer, the conversion to add or delete a carriage return character occurs automatically. Binary mode transfers are transparent transfers. Octets are transfered "as is" and nothing is added nor deleted.
If you find that you have a file in the wrong mode, you can use 'dos2ux' or 'ux2dos' to strip or add the carriage return character. See the man pages for 'dox2ux' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 03:36 PM
01-29-2006 03:36 PM
Re: transferring binary from windows to hpux
DOS text files traditionally have carriage return and line feed pairs as their newline characters while Unix text files have the line feed as their newline character. So you get ^M when you transfer windows to Unix in ASCII mode.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 03:47 PM
01-29-2006 03:47 PM
Re: transferring binary from windows to hpux
The ASCII code is a standardized computer code which corresponds every letter, number, punctuation mark, etc. to a number between 0 and 255. This is the way computers store text files: each character in the file corresponds to a byte (8 bits, 2^8 = 256 possible combinations).
The line feed (LF) has ASCII code 10, and the carriage return (CR) has ASCII code 13. When computers first proliferated, there was some debate over how the end of lines should be stored in the file. To this day, UNIX systems use only the LF, while DOS systems use CRLF.
That is, if your file looks like this:
he
llo
UNIX would store this file as: 104 - 101 - 10 - 108 - 108 - 111
while Windows would store this file as: 104 - 101 - 13 - 10 - 108 - 108 - 111.
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 04:23 PM
01-29-2006 04:23 PM
Re: transferring binary from windows to hpux
The problem is caused when a binary file ( eg: shar file) is downloaded to a pc. The pc
places
pc style end of lines in the file. The ^M is a visual representation of
the line feed not needed on unix. You can fix this by doing the
following:
# dos2ux sharfile > sharfile1
# sh sharfile1
x - README [compressed]
x - install.ksh [compressed]
x - inquiry256.1m [compressed]
x - inquiry256.ksh [compressed]
x - inquiry256 [compressed]
Hope these informations will help you..
Regards,
Shameer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 04:32 PM
01-29-2006 04:32 PM
Re: transferring binary from windows to hpux
You asked about "If binary file is transferred via ftp in bin mode from windows to hpux then do i need to take care of anything ?"
No, "bin" mode is fine for binary files. You dont need to take care of anything except checksum value.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 05:19 PM
01-29-2006 05:19 PM
Re: transferring binary from windows to hpux
# dos2ux
Use binary mode with ftp when transfer files between two different platforms.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 05:24 PM
01-29-2006 05:24 PM
Re: transferring binary from windows to hpux
If you want to remove ^M from your files,
Using Perl :
Following command will change the orginal file itself so keep a backup copy .
perl -pi -e "s:^V^M::g" existing_file_name
You won't see the Control V on typing but it is needed to generate control
character ^M.
Using sed :
sed -e `s/^V^M//g` existing_file_name > new_file_name
Using vi :
Open file in vi and enter the following at : prompt in command mode .
:%s/^V^M//g
http://www.adminschoice.com/docs/techtips.htm#Removing%20^M%20from%20unix%20text%20files
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 05:45 PM
01-29-2006 05:45 PM
Re: transferring binary from windows to hpux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 05:50 PM
01-29-2006 05:50 PM
Re: transferring binary from windows to hpux
You asked "Are there different types of binaries or all binaries are same ?"
Binaries are executable files and it differs from Windows to HP-UX. Generally, Windows binaries will have .exe extension and in Unix, there is no concept of extension.
Hope this is clear.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 06:02 PM
01-29-2006 06:02 PM
Re: transferring binary from windows to hpux
Regards,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 09:40 PM
01-29-2006 09:40 PM
Re: transferring binary from windows to hpux
Bin files are categorised as one and same for for FTP's.
to prevent you can either use a dos2unix.
also your ftp can do mget/mput
finally use "bin" at the ftp prompt before going for transfer.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 09:48 PM
01-29-2006 09:48 PM
Re: transferring binary from windows to hpux
-->>>>>>>>>>>>>>>
Yes, During the transfer of the SSL certificate file it will be trasfered with same DOS encoding. So ^M characters are existing.
Best way is to transfer with bin mode as,
ftp
ftp> bin
ftp> start other commands
FTP will not care about whether it is text or executable. It will be based on mode.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 09:51 PM
01-29-2006 09:51 PM
Re: transferring binary from windows to hpux
Simply,
a) dos2ux
More methods,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=364956
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 09:51 PM
01-29-2006 09:51 PM
Re: transferring binary from windows to hpux
Your question: "Are there different types of binaries or all binaries are same ?"
Yes. Binaries are per platform in most cases. E.g. Windows binaries is not the same as HP-UX binaries is not the same as Linux binaries.
When source codes are compiled they produce binary files which are linked to libraries and other procedures that dependent on the environment/platform.
Exception Java "binaries" (bundled as jar files) that are supposed to be platform independent.
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 09:56 PM
01-29-2006 09:56 PM
Re: transferring binary from windows to hpux
You asked about " My question was with respect to WebServer SSL certificate files which we consider as binary files. I was wondering the binaries which are created by compiling programs are different in what respect to the certificate files".
When you transfer webserver certificate from Windows to unix in ASCII mode, you will get ^M in certificate, To avoid this, you can transfer in bin mode.
ftp> bin
200 Type set to I.
ftp>
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 10:00 PM
01-29-2006 10:00 PM
Re: transferring binary from windows to hpux
You can simply use,
# tr -d '\015' filename
# tr -d '\r'
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2006 10:05 PM
01-29-2006 10:05 PM
Re: transferring binary from windows to hpux
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2006 08:11 PM
01-30-2006 08:11 PM
Re: transferring binary from windows to hpux
this occurs because you transfer the ascii file with binary option in FTP and this will case the ^M you see in the file. To avoid this transfetr the ascii file in ascii mode and ftp will automatically convert to the rigth format or remove ^M at th unix side.
A lot of option to remove ^M:
dos2ux
vi -c "%s/^M//g|wq" filename (type ctlr V ctrl M to obtain ^M)
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2006 12:24 AM
01-31-2006 12:24 AM
Re: transferring binary from windows to hpux
The same is true on PCs. You can safely assume that executable programs are 100% *incompatible* between machines that are running different OS's. Even among PCs, a binary exceutables are often incompatible between different versions of Windows.
As far as SSL certificates go, open one with Notepad and see if you can read it. If the text is unreadable, then it is a binary file and must be transferred in binary mode. Transferring a binary file in ASCII mode will corrupt the file.
Bill Hassell, sysadmin