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


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Is there a limit in number of lines to be Copy pasted in VI editor ?
# 1  
Old 12-17-2012
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 ?
# 2  
Old 12-17-2012
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:
Code:
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
Code:
tar cvf tarball_filename  ./filename

scp ----------------- from AIX to the windows box -- on the windows box
then 7zip can un pack it.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 12-17-2012
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 (??).
This User Gave Thanks to cjcox For This Post:
# 4  
Old 12-17-2012
I've never faced such an issue, but it seems easy to work around:

1. Use cat, instead of vi:

Code:
cat > infile
... paste here ...
hit Ctrl-D/^D to indicate EOF

2. Convert the files using dos2unix after the secure copy (scp).
This User Gave Thanks to radoulov For This Post:
# 5  
Old 12-17-2012
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.
# 6  
Old 12-17-2012
Quote:
Originally Posted by kraljic
[...]
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?
# 7  
Old 12-17-2012
Quote:
Originally Posted by kraljic
[...]
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. )[...]
Just noticed this ...
Note that WinSCP (a free product) supports ASCII mode for scp.
Is there a limit in number of lines to be Copy pasted in VI editor ?-transfer_custompng
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copy/paste in vi editor

Hello guys, I am trying to copy a line in vi editor and paste it with below commands but paste command is not working and instead of paste action prints the p character!! I should also mention that the server is Solaris... 1) crontab -e 2) j to move down 3) yy to copy the line 4) o to... (4 Replies)
Discussion started by: Newman
4 Replies

2. Shell Programming and Scripting

Copy-pasted code behaves diffrent

Heyas I'm currently attempting to apply the code of tui-select to tui-list. That is because tui-list simply made a 1 string list, while tui-select uses dynamicly up to 3 strings per line. Anyway, so i copy pasted the code, and just made the changes marked with red.... Know that both scripts... (2 Replies)
Discussion started by: sea
2 Replies

3. Shell Programming and Scripting

Reading from a file with limit number of lines

Hi, I am trying to pull data from a txt file which has 51 lines Example AK AR AL AZ CA CO CT Now i want to send above data as input to script but i want to run them twice at a time in a nohup like nohup Script_name AK & (3 Replies)
Discussion started by: krux_rap
3 Replies

4. UNIX for Dummies Questions & Answers

Limit Number of files

hi guys how can i limit number of files in a disk or partition ? or how can i make a limit to inode number for a disk or partition ? ext3 or ext4 file system (1 Reply)
Discussion started by: mhs
1 Replies

5. Shell Programming and Scripting

Limit on Number of characters in a line - Vi editor

In the vi editor, there seems to be some limit on the number of characters could be allowed in single line. I tried a line with characters up to 1880. It worked. But when i tried with something of 5000 characters, it doesnt work. Any suggestions. Thanks in advance! (2 Replies)
Discussion started by: nram_krishna@ya
2 Replies

6. UNIX for Dummies Questions & Answers

Copy/Paste in Vi editor

Dear All, I have a file containing 12 lines. First 3 lines have 9 values and the remaining 9 lines with no values. I was trying to copy and paste these 9 values of the first 3 lines into last 9 lines simultaneously as A=1.491331, B=1.539000 ..... but I don't know how to cope with this... (9 Replies)
Discussion started by: sullah
9 Replies

7. Shell Programming and Scripting

Vi editor, copy one column?

This is an vi editor question. I do not know is this a right place to ask this question or not? I have a file with the following contents, 10 11 20 21 30 31 I want to copy first column that is 10,20,30 after second column, so that output will look like the following, 10 11 10 20 21 20... (3 Replies)
Discussion started by: MeetP
3 Replies

8. Solaris

How to limit number of Commands

Is there a way that I can limit number of commands that one user can run during period of time. For example Max 10 commands per senconds.:) (3 Replies)
Discussion started by: winger0608
3 Replies

9. UNIX for Dummies Questions & Answers

Number of long limit

Hi Hi! I'm currently using AIX 5.2 and would like to know where can i find to see that there's a restriction on the number of login times a user can have. Example, I want give a 2 login per user but some one to give 3 login and some one have to give unlit login time (without logging off the... (2 Replies)
Discussion started by: herath
2 Replies

10. Shell Programming and Scripting

Limit of number of lines for awk and sed.

Hi, I'm using awk and sed to extract some data out from a text file. The text file consists of data over a million (prolly millions) of lines. Question: Is there a limit of number of lines for awk and sed? Thanks in advance. (2 Replies)
Discussion started by: 60doses
2 Replies
Login or Register to Ask a Question