> Daniel Colascione wrote: > > Well, I don't know whether Chet left the feature enabled by > > default. I hope he did, though, since preventing execution of pasted > > commands is one of the feature's key benefits. In bash, you should > > be able to execute a pasted command sequence by typing RET after the > > paste, but a paste by itself should never begin execution. > > I use paste into the shell with an embedded newline in order to > immediately execute a command *a lot*. If that were removed I would > be very unhappy.
There are a number of strategies you can employ if you're closer to Daniel than Bob on this and you want to avoid executing pasted shell commands with the current version of bash. Even if you don't want to change your selection habits to avoid selecting the entire line, there are a few things you can do: * configure your terminal emulator, if possible, to remove trailing newlines in pasted text * paste into a text editor running in a separate window, edit the command if desired, then re-select and re-paste into your terminal window * paste into the text editor invoked by the `edit-and-execute-command' key binding (C-xC-e in emacs mode), edit the command if desired, and have the shell automatically execute the contents of the editing buffer when the editor exits Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/