Update: This is a more general command that is more reproducible. ShellFish identified that there is a more general pattern:
non-existingcommand & existingcommand &
for example,
xyz & echo &
Also, I had a coworker try over an ssh connection and his connection was closed after running the command. So this doesn't appear to be limited to a certain terminal emulator.
Original question:
echo?a=1&b=2|3&c=4=
Behavior:
After executing the command, my current Gnome Terminal tab closes without warning.
Background:
We were testing a URL with a curl command but forgot to quote it or escape the special characters (hence the ampersands and equals signs). Expecting some nonsense about syntax issues or commands not found, we instead watched our shell simply quit. We spent some time narrowing the command down to the minimum that would cause the behavior.
We are using Gnome Terminal on Ubuntu 14.10. Strangely, the behavior is not present on another box I have running byobu even if I detach from the session. It also doesn't happen on Cygwin. Unfortunately I'm limited to testing with Ubuntu 14.10 otherwise.
Note: The following command also kills my terminal but only about half of the time:
echo?a=1&b=2&c=3=
Additional tests:
Someone recommend using a subshell...
guest-cvow8T@chortles:~$ bash -c 'echo?a=1&b=2|4&c=3='
bash: echo?a=1: command not found
guest-cvow8T@chortles:~$ bash: 4: command not found
No exit.
question from:
https://stackoverflow.com/questions/31074910/why-does-this-command-kill-my-shell 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…