I have sent the same file from win to Linux in both, binary and ascii modes. In both cases [dos] sign att he bottom of the file when received at linux end says that it has some dos chars.
What do you mean by "[dos] sign" this is definitely not a diagnostic message of the ftp command, yes?
Quote:
Originally Posted by Albert_Pinto7
But, modes are not the issue as in both the modes we have to run dos2unix on the said file when received on linux.
Of course they are, but you have probably not yet identified the culprit. The only thing "dos2unix" and similar tools do is to replace <CR><LF>-styly line ends (DOS/Win) to <NL>-style line ends (UNIX). Use a hex editor on what you call a DOS-file and on what you call a UNIX-file and you will see this exact difference described in the post i linked to above.
Create a test file (in UNIX) of two lines, like this:
and use this command in UNIX to display it:
then transfer it, so that it is converted to "DOS" mode, then do the same again. You will see the difference easily.
I'm having some probs and i know in unix i can do a dos2unix command and fix it, and it looks like that may be my problem now, but linux doesn't have dos2unix of course, anything comparable? (4 Replies)
I have a bunch of text files that currently reside on a red hat linux machine. I'd like to zip them up and copy them to a windows machine. I'm not sure about how to do this though since I believe zipping files up creates a totally different format that will be unreadable on windows. Is there any... (3 Replies)
Hello all
It seams that in HPUX when Im using dos2unix program
I need to rename the file to new file and then back if I like to
Format the file.
Is there shorter way to do this?
Thanks (2 Replies)
Hi All,
p_ftp=dummy
time ftp -niv 192.0.0.2 << EOF
user dummy dummy
cd prt/$p_ftp
ascii
ls -ltr
quit
output is
-rw-r--r-- 1 500 500 5137 Mar 04 11:21 dummy.csv
can any one suggest how to get year while using ftp (1 Reply)
Hello dear community!
I have the following task to accomplish: there is a directory with approximately 2 thousand files. I have to write a script which would randomly extract 200 files on the first run. On the second run it should extract again 200 files but that files mustn't intersect with... (5 Replies)
Hi everyone,
I have oracle 9i installed in Windows XP and i have ubuntu in VM WARE.
I would like to know how to connect to Oracle in windows xp from Linux through shel scripting...... (3 Replies)
Hi All,
I have pearl script which will check and convert the file:
INFO("dos2unix_cmds".$#{$dos2unix_cmds});
if ( $#{$dos2unix_cmds} == 0 ) {
my $convert_cmd = $$dos2unix_cmds;
my $rename_cmd = $$dos2unix_cmds;
--conversion going here
else
INFO ("No need to... (8 Replies)
Dear all,
I had a columned based file after processed from my script. In unix platform, my file is ok, with all columns sorted out nicely. But when i open in windows notepad, the columns are running out of order. Can some one help??
Thanks alot in advance (4 Replies)
Discussion started by: ymeyaw
4 Replies
LEARN ABOUT X11R4
dos2unix
dos2unix(1) User Commands dos2unix(1)NAME
dos2unix - convert text file from DOS format to ISO format
SYNOPSIS
dos2unix [-ascii] [-iso] [-7] [-437 | -850 | -860 | -863 | -865] originalfile convertedfile
DESCRIPTION
The dos2unix utility converts characters in the DOS extended character set to the corresponding ISO standard characters.
This command can be invoked from either DOS or SunOS. However, the filenames must conform to the conventions of the environment in which
the command is invoked.
If the original file and the converted file are the same, dos2unix will rewrite the original file after converting it.
OPTIONS
The following options are supported:
-ascii Removes extra carriage returns and converts end of file characters in DOS format text files to conform to SunOS require-
ments.
-iso This is the default. It converts characters in the DOS extended character set to the corresponding ISO standard charac-
ters.
-7 Converts 8 bit DOS graphics characters to 7 bit space characters so that SunOS can read the file.
On non-i386 systems, dos2unix will attempt to obtain the keyboard type to determine which code page to use. Otherwise, the default is US.
The user may override the code page with one of the following options:
-437 Use US code page
-850 Use multilingual code page
-860 Use Portuguese code page
-863 Use French Canadian code page
-865 Use Danish code page
OPERANDS
The following operands are required:
originalfile The original file in DOS format that is being converted to ISO format.
convertedfile The new file in ISO format that has been converted from the original DOS file format.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
SEE ALSO unix2dos(1), ls(1), attributes(5)DIAGNOSTICS
File filename not found, or no read permission
The input file you specified does not exist, or you do not have read permission. Check with the SunOS command, ls -l (see ls(1)).
Bad output filename filename, or no write permission
The output file you specified is either invalid, or you do not have write permission for that file or the directory that contains it.
Check also that the drive or diskette is not write-protected.
Error while writing to temporary file
An error occurred while converting your file, possibly because there is not enough space on the current drive. Check the amount of
space on the current drive using the DIR command. Also be certain that the default diskette or drive is write-enabled (not write-pro-
tected). Notice that when this error occurs, the original file remains intact.
Translated temporary file name = filename.
Could not rename temporary file to filename.
The program could not perform the final step in converting your file. Your converted file is stored under the name indicated on the
second line of this message.
SunOS 5.10 14 Sep 2000 dos2unix(1)