Skip to main content
added 243 characters in body
Source Link
frabjous
  • 9.2k
  • 1
  • 38
  • 34

You could create a wrapper script that basically looked like this:

#!/bin/bash -i
./new-script.sh
bash

And then run [terminal] -e wrapper-script.sh.

The -i flag in the shebang will make the wrapper script run in interactive mode, so it will load .bashrc; then it will run new-script.sh, and then it'll start a new bash instance so you can run whatever commands you want afterwards in that instance.

(Or you can put the -i flag on the shebang of the ./new-script.sh if wanted it always to do that.)

If you don't want to be able to run commands afterwards, but just want the terminal to hold open, then you can leave out the second bash and use whatever flag or setting or profile is appropriate for doing that depending on the terminal.

You could create a wrapper script that basically looked like this:

#!/bin/bash -i
./new-script.sh
bash

And then run [terminal] -e wrapper-script.sh.

The -i flag in the shebang will make the wrapper script run in interactive mode, so it will load .bashrc; then it will run new-script.sh, and then it'll start a new bash instance so you can run whatever commands you want afterwards in that instance.

(Or you can put the -i flag on the shebang of the ./new-script.sh if wanted it always to do that.)

You could create a wrapper script that basically looked like this:

#!/bin/bash -i
./new-script.sh
bash

And then run [terminal] -e wrapper-script.sh.

The -i flag in the shebang will make the wrapper script run in interactive mode, so it will load .bashrc; then it will run new-script.sh, and then it'll start a new bash instance so you can run whatever commands you want afterwards in that instance.

(Or you can put the -i flag on the shebang of the ./new-script.sh if wanted it always to do that.)

If you don't want to be able to run commands afterwards, but just want the terminal to hold open, then you can leave out the second bash and use whatever flag or setting or profile is appropriate for doing that depending on the terminal.

Source Link
frabjous
  • 9.2k
  • 1
  • 38
  • 34

You could create a wrapper script that basically looked like this:

#!/bin/bash -i
./new-script.sh
bash

And then run [terminal] -e wrapper-script.sh.

The -i flag in the shebang will make the wrapper script run in interactive mode, so it will load .bashrc; then it will run new-script.sh, and then it'll start a new bash instance so you can run whatever commands you want afterwards in that instance.

(Or you can put the -i flag on the shebang of the ./new-script.sh if wanted it always to do that.)