Questions tagged [subshell]
Use where a shell is run inside a shell (nested shells)
246 questions
0 votes
2 answers
131 views
Process sed capture group with a bash function before replacement: "sh: 1: <bash function>: not found"
So, I was playing around with this answer, when I found that neither printf_stdin () { read input printf "$input" } sed "/lorem ipsum foobar/ { s/'/'\"'\"'/g s/\...
4 votes
2 answers
348 views
Deferred variable expansion including in a subshell
I have a command that takes always the same initial parameters. I can create a variable to capture these parameters. Also, I need to pass the output of a subshell running the same command to the ...
0 votes
2 answers
99 views
How to temporarily substitute the login shell for running a shell command/subprocess?
My login shell is Fish, but I would like to execute a shell command (apt install ...) as if my login shell was Bash. Is it possible to make a command/subprocess believe that my login shell is /usr/bin/...
0 votes
0 answers
38 views
bash subshell execution behaves unexpectedly [duplicate]
I have a script which is supposed to fetch 2 URLs sequentially: #!/bin/bash wget_command='wget --restrict-file-names=unix https://www.example.com/{path1,path2}/' $($wget_command) echo $wget_command ...
1 vote
0 answers
92 views
What's the logic in exiting early on failure in blocks and subshells in Bash? [duplicate]
In Bash blocks {} and subshells () the exit early doesn't work if there is an OR condition following it. Take for example set -e { echo a; false; echo b; } || echo c prints a b and set -e { echo a; ...
1 vote
0 answers
26 views
Why is the first sub-command of my remote command not executing or not affecting later sub-commands? [duplicate]
This command is a simplification of the problem I've come across: ssh grinder1h.devqa sh -c "cd /etc/ssh && pwd" This command gives an output of "/home/fetch", which is ...
0 votes
1 answer
83 views
How to exit a shell if the subshell exit with an error [closed]
there is a script, 1.sh. 1.sh starts 1a.sh and then 1b.sh. But how to exit all scripts, how to exit 1.sh and how to not start 1b.sh if 1a.sh breaks with an error?
0 votes
1 answer
435 views
Is it possible to give an existing Flatpak application permission to run another Flatpak?
You can give a Flatpak permissions to access files/folders outside of its sandbox using the techniques described in this Ubuntu Stack Exchange QA. But is it possible to give an existing Flatpak ...