You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: fish command which starts with a subshell #936
In bash, I've been using a command like the following to check queue lengths on gearman daemons. The subshell and sleep are to (as far as I can tell) keep the connection to the gearmand open long enough to get a response over a slow link.
# Sometimes returns no data over a slow link
$ echo status | netcat gearmand-01 7003
# Keeps connection open long enough to get reply.
$ (echo status ; sleep 0.5) | netcat gearmand-01 7003
I've been unable to work out an equivalent command with fish, as it seems like you can't start a command with a subshell. Is there another way of doing this?
There is a slow workaround doing something like the following, but it has only second-resolution, so the command will take at least 2 seconds to complete, which adds up when many hosts are being polled.
# Use the interval param to netcat
$ echo status | netcat -i 1 gearmand-01 7003
Or a simpler question: how to replicate something like $(brew --prefix mysql)/bin/mysqladmin. Using (brew --prefix mysql)/bin/mysqladmin chokes because it's an "Illegal command name"
Activity
ridiculousfish commentedon Jul 29, 2013
Try this:
d5ve commentedon Jul 29, 2013
Thanks for the comment. I tried the following command as suggested, but didn't get back any response.
It appears that there is a difference in behaviour between both methods.
sugar700 commentedon Jul 29, 2013
Yeah, it seems that fish waits
0.5seconds before outputingstatus(for some reason, pipes with blocks are broken in fish shell).nicktimko commentedon Nov 9, 2016
Or a simpler question: how to replicate something like
$(brew --prefix mysql)/bin/mysqladmin. Using(brew --prefix mysql)/bin/mysqladminchokes because it's an "Illegal command name"krader1961 commentedon Nov 9, 2016
The solution today is
eval (brew --prefix mysql)/bin/mysqladmin). The long term solution to this limitation will be addressed in issue #154.krader1961 commentedon Mar 15, 2017
The alternative to
(...)isfish -c; e.g.,fish -c 'echo status; sleep 0.5'.foxpy commentedon Mar 1, 2019
But how do I do this?