allow providing command as parameter — e.g.: up grep
pannous opened this issue · comments
please allow giving command to up as parameter (also to avoid the rm nightmare)
Thanks for the idea! I'd like to actually do this indeed at some point in future.
This would work for my ghci stuff.
Note to self: because we now support various different shells (which have different standards for quoting), the full pipeline would have to be passed as a single argument (in quotes). For symmetry with a convention that seems popular among Linux tools, I think it would be a good idea then to pass it via a "-c" flag. Example call would then look like below:
$ lshw |& up -c "grep network -A2 | grep :"
edit: This flag could also be used to load commands from old upN.sh scripts, e.g. in bash:
$ lshw |& up -c "$( tail -n1 up1.sh )"
This could possibly be shortened to:
$ lshw |& up --command-from up1.sh
(+ internally: assert( len(lines) == 1 || (len(lines)==2 && lines[0].startsWith("#")) )
)
@puffnfresh Does the $SHELL discovery feature added in v0.3 work for you for ghci?