Is there a limit in number of lines to be Copy pasted in VI editor ?

In my old shop, we only had AIX machines there (all of version 6.1 ). FTP ports were not open for these AIX machines because of some security thing. So, we can't ftp scripts in ASCII mode.
When we wanted to copy huge scripts (shell scripts, sql scripts , ..etc) from our Windows based laptop (scripts in notepad or textpad ) to those AIX machines, we had to manually copy and paste to the vi editor in the AIX machine because SCPing the scripts can introduce unwanted characters ( SCP can be done only in bin mode. )

So, when I tried copying big scripts , VI editor in AIX didn't allow more than 100 lines to be copied at a time. So, for a 1000 line script , we had to copy paste 10 times part by part!

In my new shop , we have both AIX (5.3) and RHEL 5.4 . But i did manage to copy and paste a 2000 line script from Windows XP notepad to VI editors in both AIX and RHEL in one go. VI editor doesn't seem to have a limit of 100 lines here. Only difference from my Old shop and here is that i am using putty in the current shop. In my earlier shop where I encountered the 100 line limit , I was using tectia as the ssh client . Could this be the reason ? Have you guys faced a similair situation ?

I am not aware of a cut/paste limit like that in any modern version of vi. I have not used tectia, so I cannot blame or exonerate it.

FWIW. If you have a huge file, tar it, then scp the tarball, untar the file on AIX.
7zip is free for windows and can work with tar archives.

To unpack a tar archive in UNIX:

tar tf tarball_filename
# get the EXACT name the file has including the ./ in front
tar xf tarball_filename

This will create the file in the current working directory.

to copy a file from UNIX to widows

tar cvf tarball_filename  ./filename

scp ----------------- from AIX to the windows box -- on the windows box
then 7zip can un pack it.

Most all Linux distributions use vim (Vi IMproved). This is why you can do more there. Yes, the original "vi" that comes with archaic Unix based systems is pretty limited. Don't expect miracles there. However, many of those legacy OS's, including AIX, do support the installation of programs like vim, so maybe that is a solution (??).

I've never faced such an issue, but it seems easy to work around:

  1. Use cat, instead of vi:
cat > infile
... paste here ...
hit Ctrl-D/^D to indicate EOF
  1. Convert the files using dos2unix after the secure copy (scp).

Thank you for your workarounds Radoulov.

Radoulov said:
Convert the files using dos2unix after the secure copy (scp).

dos2unix is meant for removing only Control^M characters. Right ? I think SCPing an ASCII file (in bin mode) can introduce other unwanted characters as well.

Well,
I really don't know, could you provide a reproducible test case?

Just noticed this ...
Note that WinSCP (a free product) supports ASCII mode for scp.