←back to thread

217 points tanelpoder | 1 comments | | HN request time: 0.21s | source
Show context
fouric ◴[] No.26492914[source]
If you could configure the common shells (bash, zsh, fish) to run a custom command on submitted shell input before executing, you could build a heuristic function that would attempt to recognize when you were pasting in a prompt. Unfortunately, I'm not aware of such a capability, as it would be useful in a number of situations.

Another alternative is to put the octothorpe # at the beginning of your prompt - then you can keep your > at the end.

replies(2): >>26493527 #>>26494355 #
1. Symmetry ◴[] No.26494355[source]
Fish just doesn't seem to process the redirected output to clobber the file when a command isn't found. If your prompt is a valid command it can clobber a binary but not otherwise, apparently.