Skip to main content
deleted 6 characters in body
Source Link
user243760
user243760

This is the only thing that works for what I needed to accomplish (creating a virtual environment then activating it, then installing requirements from a bash script):

spawn a subshell / child shell from the script, as in:

stupid_file.sh

( set -o errexit #bunch of commands #one line fails ) 

run the stupid_file using:

source stupid_file.sh <file arguments here> || true 

THE END.

** takes a bow **

(credit goes to the above two postersJeff and Terdon)

This is the only thing that works for what I needed to accomplish (creating a virtual environment then activating it, then installing requirements from a bash script):

spawn a subshell / child shell from the script, as in:

stupid_file.sh

( set -o errexit #bunch of commands #one line fails ) 

run the stupid_file using:

source stupid_file.sh <file arguments here> || true 

THE END.

** takes a bow **

(credit goes to the above two posters)

This is the only thing that works for what I needed to accomplish (creating a virtual environment then activating it, then installing requirements from a bash script):

spawn a subshell / child shell from the script, as in:

stupid_file.sh

( set -o errexit #bunch of commands #one line fails ) 

run the stupid_file using:

source stupid_file.sh <file arguments here> || true 

THE END.

** takes a bow **

(credit goes to Jeff and Terdon)

easier to read.
Source Link
user243760
user243760

So,This is the only thing that works for what I ended up basically using terdon's solutionneeded to accomplish (creating a virtual environment then activating it, except I just spawned thethen installing requirements from a bash script):

spawn a subshell / child shell from the script, as in:

createstupid_file.sh

( set -o errexit #bunch of commands #one line fails ) 

This allows me to not paste || return everywhere and allows me to call create.sh from the terminal, without causingrun the terminal itselfstupid_file using:

source stupid_file.sh <file arguments here> || true 

THE END.

** takes a bow **

(credit goes to exitthe above two posters)

So, I ended up basically using terdon's solution, except I just spawned the subshell / child shell from the script, as in:

create.sh

( set -o errexit #bunch of commands #one line fails ) 

This allows me to not paste || return everywhere and allows me to call create.sh from the terminal, without causing the terminal itself to exit

This is the only thing that works for what I needed to accomplish (creating a virtual environment then activating it, then installing requirements from a bash script):

spawn a subshell / child shell from the script, as in:

stupid_file.sh

( set -o errexit #bunch of commands #one line fails ) 

run the stupid_file using:

source stupid_file.sh <file arguments here> || true 

THE END.

** takes a bow **

(credit goes to the above two posters)

Source Link
user243760
user243760

So, I ended up basically using terdon's solution, except I just spawned the subshell / child shell from the script, as in:

create.sh

( set -o errexit #bunch of commands #one line fails ) 

This allows me to not paste || return everywhere and allows me to call create.sh from the terminal, without causing the terminal itself to exit