Questions tagged [subshell]

The tag has no usage guidance.

1
vote
2answers
93 views

Is it possible to findout if our command is sourced from a script or manually typed on command line?

We have an implementation to set environment for a particular tool with our custom command. Eg: custom_command tool_name This command logs the invokation time, user and tool_name in a log file. And ...
1
vote
1answer
239 views

Child process - listen for event when parent dies

I have a detached child process. It knows its parent's pid. Is there some way on both MacOS and Linux that I can listen for when the parent process exits, from the child process? I need to make a ...
2
votes
0answers
220 views

Tmux status bar flashes command from #() before displaying result

I currently use the following command to display the current git branch or mercurial bookmark for the pane's working directory. It works correctly as far as I can tell, but just before it computes ...
1
vote
0answers
67 views

Export vars env to tmux's window/session/pane's env

Is there any way to export/upgrade list of variable env from a file or something to tmux's window/session/pane? Here I have to manually source .bashrc to update new var env to each tmux's pane.
1
vote
0answers
1k views

Restoring tty correctly with stty

I'm writing a bash script to read some user input (like a password request), and I'd like to capture the result and pass it through its stdout. (I'm working in a GNU/Linux environment, with recent ...
1
vote
0answers
286 views

Start a subshell then run commands

Say I have a script that is always run from an interactive shell. I would like this script to launch an interactive subshell that is a replica of the parent (i.e., all environment variables, etc. ...
0
votes
0answers
48 views

Run script in background using `&` or `()&`?

If I want to run a script in background, for example a.sh, should I run ./a.sh & or should I put it in a subshell then background it? (./a.sh) & I test both and don't see difference, both ...