Re: issue with transferring text files from windows to *INX using scp/sftp

2008-02-13 Thread Kosala Atapattu
Not sure whether \r is handled in all unices. IINM AIX does not detect
\r in vi or sed. In AIX we hadle it through ctrl + v and ctrl + m.

Kosala

On Feb 12, 2008 8:33 PM, Christian Grunfeld
<[EMAIL PROTECTED]> wrote:
> What I do is %s/\r//g in vi or sed to remove the trailing CRs
>
> Cheers
> Christian
>
>
> 2008/2/12, Russell Millard Oliver <[EMAIL PROTECTED]>:
>
> > SFTP does not handle ascii files, you'll need to do it in your client.
> > Depending on which client you are using, there is probably a setting to
> > tell it to transfer ascii files and which files it should consider ascii
> > by extension.  If you aren't moving the standard .txt files, then add
> > your extension to that list.  I noticed that some clients, like
> > Filezilla, don't convert the files like it seems like they should.
> > WinSCP works well for that.
> >
> > Good luck,
> > Russ
> >
> > -Original Message-
> > From: Mike Li [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 11, 2008 3:13 PM
> > To: secureshell@securityfocus.com
> > Subject: issue with transferring text files from windows to *INX using
> > scp/sftp
> >
> > HI:
> > Each line of text files transferred from windows to
> > *INX using scp/sftp contains Control-M characters.
> > It is a pain to run dos2unix utils when there are a
> > few hundred files.
> > I did not experience issue when using ftp to transfer
> > files from windows to *INXs systems
> > Is there a switch or ssh_config configuration setting
> > to suppress the Crontrol-M during transfer ?
> > Thank you
> > Mike
> >
> >
> >
> > 
> > 
> > Looking for last minute shopping deals?
> > Find them fast with Yahoo! Search.
> > http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> >
>



-- 
Kosala

Disclaimer: Views expressed in this mail are my personal views and
they would not reflect views of the employer.

blog.kosala.net
www.linux.lk/~kosala/
www.kosala.net


Re: issue with transferring text files from windows to *INX using scp/sftp

2008-02-12 Thread Christian Grunfeld
What I do is %s/\r//g in vi or sed to remove the trailing CRs

Cheers
Christian


2008/2/12, Russell Millard Oliver <[EMAIL PROTECTED]>:
> SFTP does not handle ascii files, you'll need to do it in your client.
> Depending on which client you are using, there is probably a setting to
> tell it to transfer ascii files and which files it should consider ascii
> by extension.  If you aren't moving the standard .txt files, then add
> your extension to that list.  I noticed that some clients, like
> Filezilla, don't convert the files like it seems like they should.
> WinSCP works well for that.
>
> Good luck,
> Russ
>
> -Original Message-
> From: Mike Li [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 11, 2008 3:13 PM
> To: secureshell@securityfocus.com
> Subject: issue with transferring text files from windows to *INX using
> scp/sftp
>
> HI:
> Each line of text files transferred from windows to
> *INX using scp/sftp contains Control-M characters.
> It is a pain to run dos2unix utils when there are a
> few hundred files.
> I did not experience issue when using ftp to transfer
> files from windows to *INXs systems
> Is there a switch or ssh_config configuration setting
> to suppress the Crontrol-M during transfer ?
> Thank you
> Mike
>
>
>
> 
> 
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.
> http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>


Re: issue with transferring text files from windows to *INX using scp/sftp

2008-02-12 Thread Mike Li
Thank you those who replied to my query and explained
the source of Control-M. 
I also found this to work the following to work:
find /directory -type f -exec perl -p -i -e 's/^M$//g'
{} \;
^M is inserted via Control-V+Control-M

--- Mike Li <[EMAIL PROTECTED]> wrote:

> HI:
> Each line of text files transferred from windows to
> *INX using scp/sftp contains Control-M characters. 
> It is a pain to run dos2unix utils when there are a
> few hundred files.
> I did not experience issue when using ftp to
> transfer
> files from windows to *INXs systems
> Is there a switch or ssh_config configuration
> setting
> to suppress the Crontrol-M during transfer ?
> Thank you
> Mike
> 
> 
>  
>

> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search. 
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> 



  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


Re: issue with transferring text files from windows to *INX using scp/sftp

2008-02-12 Thread Frank S. Bernhardt

Good morning Mike.


Each line of text files transferred from windows to
*INX using scp/sftp contains Control-M characters. 
It is a pain to run dos2unix utils when there are a

few hundred files.


I can definitely see that.


I did not experience issue when using ftp to transfer
files from windows to *INXs systems


ftp is a different animal.


Is there a switch or ssh_config configuration setting
to suppress the Crontrol-M during transfer ?


Not that I have been able to find (but I'm no sftp/scp guru). If you 
were going the other way *NIX to windows then it would be trivial to 
write a shell script to do all that for you. For example:


# just put all the files to send into the directory called 'tosend'
# and create another directory called 'sent' and be in in the
# directory right above the 2 tmp directories when you run
# the script

for file in `ls tosend`
   do
  [command-to-remove-cr-from-file] tosend/$file >$file.tmp
or
  [command-to-remove-cr-from-file] tosend/$file -o $file.tmp
  scp $file.tmp [EMAIL PROTECTED]:/path-to-directory/$file
  mv tosend/$file sent
  rm $file.tmp
   done

This is an inelegant script and I'm sure that the 'real' *NIX admins out 
there could do a better job (after they stop laughing), but you get the 
idea.


So, how does this help you running under windows? Well, there is a UNIX 
environment you can install from microsoft but I personally use Cygwin 
(cygwin.com). Just install that and you're away to the races.


Hope this helped.

Cheers.
begin:vcard
fn:Frank Bernhardt
n:Bernhardt;Frank
org:b.c.s.i.
adr:;;14 Halton Court;Markham;ON;L3P 6R3;Canada
email;internet:[EMAIL PROTECTED]
title:President
tel;work:905-471-1691
tel;fax:905-471-3016
tel;cell:416-540-7694
version:2.1
end:vcard



RE: issue with transferring text files from windows to *INX using scp/sftp

2008-02-12 Thread Russell Millard Oliver
SFTP does not handle ascii files, you'll need to do it in your client.
Depending on which client you are using, there is probably a setting to
tell it to transfer ascii files and which files it should consider ascii
by extension.  If you aren't moving the standard .txt files, then add
your extension to that list.  I noticed that some clients, like
Filezilla, don't convert the files like it seems like they should.
WinSCP works well for that.

Good luck,
Russ

-Original Message-
From: Mike Li [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 11, 2008 3:13 PM
To: secureshell@securityfocus.com
Subject: issue with transferring text files from windows to *INX using
scp/sftp

HI:
Each line of text files transferred from windows to
*INX using scp/sftp contains Control-M characters. 
It is a pain to run dos2unix utils when there are a
few hundred files.
I did not experience issue when using ftp to transfer
files from windows to *INXs systems
Is there a switch or ssh_config configuration setting
to suppress the Crontrol-M during transfer ?
Thank you
Mike


 


Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping


Re: issue with transferring text files from windows to *INX using scp/sftp

2008-02-12 Thread Bryan Christ
Mike your problem is not with scp.  The scp tool just copies raw bytes.
The Control-M is already present in the file (it's the MS way).

The reason you didn't see this with ftp is because some ftp clients have
two data modes (binary and plain text).  Binary is the "genuine"
transfer method.  The latter is to accommodate this Control-M problem.
Some ftp clients even "auto-detect" the file type for you and choose the
"plain-text" method.

If you want to verify what I am telling you, just download a hex editor
for Windows (like AXE) and open one of your plain text files.  You will
see the Control-M characters.

On Mon, 2008-02-11 at 22:12 +, Mike Li wrote:
> HI:
> Each line of text files transferred from windows to
> *INX using scp/sftp contains Control-M characters.
> It is a pain to run dos2unix utils when there are a
> few hundred files.
> I did not experience issue when using ftp to transfer
> files from windows to *INXs systems
> Is there a switch or ssh_config configuration setting
> to suppress the Crontrol-M during transfer ?
> Thank you
> Mike
> 
> 
>   
> 
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.  
> http://tools.search.yahoo.com/newsearch/category.php?category=shopping



issue with transferring text files from windows to *INX using scp/sftp

2008-02-11 Thread Mike Li
HI:
Each line of text files transferred from windows to
*INX using scp/sftp contains Control-M characters. 
It is a pain to run dos2unix utils when there are a
few hundred files.
I did not experience issue when using ftp to transfer
files from windows to *INXs systems
Is there a switch or ssh_config configuration setting
to suppress the Crontrol-M during transfer ?
Thank you
Mike


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping