My script is:
/opt/Myapplication/bin/start.sh
I always have to start it this way:
$cd /opt/Myapplication
$bin/start.sh
Now I want to write a script, which will run start.sh as above. I mean, it should run it from /opt/Myapplication directory
Maybe like this:
#!/bin/bash
my_path=/opt/Myapplication
$my_path/bin/start.sh
Will it run start.sh from /opt/Myapplication directory?
it will run
/opt/Myapplication/my_path/bin/start.sh, but it won’t change the working directory, if that’s what you mean. To do that, you’ll have tocdin the script first: