This seems pretty cool. Not sure if I will remember to use it but might work better than a txt file I keep handy. Though for my most common annoyingly long commands I normally create an alias.
The improvement is that piping commands together doesn't require tedious text-munging while the console output looks basically the same. Which I think you could have figured out if you thought a little harder before jumping to snark.
Exactly, that is the point. Also, some commands require several parameters and it's much better having the script asking for those parameters in an interactive way.
I'm with you. I can't see myself preferring this over using my shell's interactive prompt, history, and a use of head/less at the end.
Thanks to the author and OP for sharing and it's good for other people if they find this useful, though.
EDIT: Maybe I could find this useful when the command that provides `up`'s input is not something that can be repeated for the same input. But even then, you can put it in the background with its output redirected to a file, then make the command that you would build inside `up` from a pipe like `tail -fn+1 bg-job.out | cmd`.
The only thing I would fix is the "lengthy" part. I want it to be a simple command (I suppose I could wrap it or alias it), but other than that it sounds perfect.
I realize that I have been using shell scripts for this. I just copy-paste commands and add a selector. It has the benefit that I didn't need to learn a new syntax.
More power to those who enjoy writing control flow in shell, but if I need anything beyond a single line I'm going with an interactive ipython session.
I know I could do it with a pretty straightforward script, but it's not as simple as a ctrl+f, and it requires me being on a machine w/ unix tools (i.e. not a PC or mobile device).
Yes and isn't it fun to type that in over and over - especially on a new machine where you don't have your .dotfiles yet :-/ The new command is going to really save hassle here.
reply