Run executable on background detached from terminal but with arguments
2
votes
1
answer
3308
views
I can run an executable in the background and detach it from the terminal with these commands:
$ nohup ./executable &
or
$ ./executable &
$ disown
But none work if I send arguments to the executable:
$ nohup ./executable argument &
or
$ ./executable argument &
$ disown
I have tried combining it with the .sh strings and pipes syntax but it does not work either:
$ nohup ./executable <<<$'argument' &
or
$ ./executable <<<$'argument' &
$ disown
or
$ nohup echo -e "argument" | ./executable &
or
$ echo -e "argument" | ./executable &
$ disown
EDIT: The "./executable" program accepts any number of parameters, like "./executable arg1 arg2" etc... I think the problem is that "&" gets absorbed by "./executable" as a parameter. Also, it is written in Go if that is of any help.
Asked by Azkron
(21 rep)
Apr 21, 2021, 09:43 PM
Last activity: May 23, 2025, 01:07 AM
Last activity: May 23, 2025, 01:07 AM