I have this script:
#!/bin/bash
cd ~/my-dir && bash && runall
And I added this script to my $PATH and when I run this script it does 2 things first.
- It changes the current directory and execute bash so that my shell also changes the current dir and i can work there.
- Run runall(another shell script) in this folder.
Actual Result:
Script changes my current shell directory successfully.
However, runall is not executed.
Expected Result:
Script changes current shell directory of mine to the my-dir  and then execute runall
How can I solve this?
Note:
I know that i can do this:
cd some-dir/ && runall
But this will not change my current session to that dir. I also want to change my current shell directory.
Reason:
I want to also change my current working directory so that i can run other manual commands there after runall executed.
runallwill run and then you'll be back in your old one.