Closed Jack-O-Brian closed 4 years ago
I ran into the same problem. I recommend a simpler approach:
- sh ...
+ "$@" >/dev/null 2>&1
I ran into the same problem. I recommend a simpler approach:
- sh ... + "$@" >/dev/null 2>&1
This was not completely valid but it did give me the right idea to resolve the issue. Thanks man.
While using this program, I realized devour cannot handle arguments with spaces that are usually handled.
zathura "File Space.pdf"
works in the command line, butdevour zathura "File Space.pdf"
does not, same withdevour zathura File\ Space.pdf
. You can combine the two, doingdevour zathura "File\ Space.pdf"
, but that's a bit tedious. So using some google-fu I found a way to open files with a space.While using this program, I realized devour cannot handle arguments with spaces that are usually handled.
zathura "File Space.pdf"
works in the command line, butdevour zathura "File Space.pdf"
does not, same withdevour zathura File\ Space.pdf
. You can combine the two, doingdevour zathura "File\ Space.pdf"
, but that's a bit tedious. So using some google-fu I found a way to open files with a space.
I would have merged your request but I managed to solve the porblem in one line. Thanks for pointing out the issue though.
My version was correct; the shell expands and executes the form properly. If you prefer to make it explicit, instead do something like this:
cmd="$1"; shift
"$cmd" "$@"
The $("$@")
form re-evaluates the output of the command, you can see the error by running devour.sh echo notify-send error
.
edits: I missed quotes in a couple places.
When I said your one was not completely valid, I meant to say it didn't work. If it did, I would have preferred yours as it was even terser than mine and I am a sucker for terse code. But I will give it another shot to see if I can work it out or not.
Appreciate the feedback guys. Added both of you as contributors.
While using this program, I realized devour cannot handle arguments with spaces that are usually handled.
zathura "File Space.pdf"
works in the command line, butdevour zathura "File Space.pdf"
does not, same withdevour zathura File\ Space.pdf
. You can combine the two, doingdevour zathura "File\ Space.pdf"
, but that's a bit tedious. So using some google-fu I found a way to open files with a space.