[GH-ISSUE #1595] Execute commands #1064

Closed
opened 2026-05-05 07:23:45 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @cjconstante on GitHub (Oct 8, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1595

Hi.
I am trying to execute more than 1 command with the option -c "", for example "command1; command2" but it just runs the first command. For the next, i get not found message.
If i run 1 command it works, if i add more, the next after the first, fail. There is any way to execute more than 1 command?

Thanks.

Originally created by @cjconstante on GitHub (Oct 8, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1595 Hi. I am trying to execute more than 1 command with the option -c "", for example "command1; command2" but it just runs the first command. For the next, i get not found message. If i run 1 command it works, if i add more, the next after the first, fail. There is any way to execute more than 1 command? Thanks.
gitea-mirror 2026-05-05 07:23:45 -06:00
Author
Owner

@Fred-Barclay commented on GitHub (Oct 8, 2017):

Hi @cjconstante
Can you give a specific example and output? Thanks!

<!-- gh-comment-id:334981679 --> @Fred-Barclay commented on GitHub (Oct 8, 2017): Hi @cjconstante Can you give a specific example and output? Thanks!
Author
Owner

@reinerh commented on GitHub (Oct 8, 2017):

That's because it interprets the argument as a single command, which of course it can't find.

$ firejail --quiet -c "ls; ls"
/bin/bash: ls; ls: command not found
<!-- gh-comment-id:334995750 --> @reinerh commented on GitHub (Oct 8, 2017): That's because it interprets the argument as a single command, which of course it can't find. ``` $ firejail --quiet -c "ls; ls" /bin/bash: ls; ls: command not found ```
Author
Owner

@reinerh commented on GitHub (Oct 8, 2017):

@cjconstante Try running them as arguments for the shell:
$ firejail --quiet -c sh -c "ls; ls"

<!-- gh-comment-id:334995799 --> @reinerh commented on GitHub (Oct 8, 2017): @cjconstante Try running them as arguments for the shell: `$ firejail --quiet -c sh -c "ls; ls"`
Author
Owner

@cjconstante commented on GitHub (Oct 8, 2017):

Thanks for the reply. I will try that way.
I found a solution: I created a bash script and there i type the commands i need. In the firejail command i pass -c myscript and it works.

Thanks.

<!-- gh-comment-id:335013311 --> @cjconstante commented on GitHub (Oct 8, 2017): Thanks for the reply. I will try that way. I found a solution: I created a bash script and there i type the commands i need. In the firejail command i pass -c myscript and it works. Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#1064
No description provided.