Quantcast
Channel: Bash commands get truncated when pasting multiple commands to terminal - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 4

Bash commands get truncated when pasting multiple commands to terminal

$
0
0

I copy/pasted the following 100 lines into my terminal (xterm) to execute those on a server I am connected to over ssh:

mv /long/path/to/file1 /longer/path/to/file1
mv /long/path/to/file2 /longer/path/to/file2
...
mv /long/path/to/file99 /longer/path/to/file99
mv /long/path/to/file100 /longer/path/to/file100

Unfortunately, after the copy/paste, I could not find my 100 files under /longer/path/to/

Looking at the bash history on the server I am connected to over ssh, I can see that after the first 20 commands, most of the commands got truncated:

mv /long/path/to/file1 /longer/path/to/file1
...
mv /long/path/to/file20 /longer/path/to/file20
mv /long/path/to/fi
mv /long/path/to/fi
mv /long/path/to/file23 /longer/p
mv /long/path/to/file24 /longer/path
mv /long/path/to/file25 /longer/p
mv /long/path/to/file26 /longer/p
mv /long/path/to/file27 /longer/path/t
mv /long/path/to/file28 /longer/path/to/fil
mv /long/path/to/file29 /longer/path/to/fil
mv /long/path/to/file30 /longer/path/to/file
mv /long/path/to/file31 /longer/path/to/file
...

I could find answers about how to work around this issue:

But I could not find an explanation over what is exactly happening. Notably:

  • is it a terminal-related issue (Xterm in my case)?
  • the copy/paste occurs over ssh: does this generate or magnify the issue?
  • is it a bash-related issue on the server? Would it maybe not happen with another shell?

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images