I tend to make my scripts all be relative to one another.
That way I can use dirname:
#!/bin/sh
my_dir="$(dirname "$0")"
"$my_dir/other_script.sh"
More Related Contents:
- Make Bash handle variables like Batch
- Some troubles with using sed and awk [closed]
- Why would a correct shell script give a wrapped/truncated/corrupted error message? [duplicate]
- Delete all but the most recent X files in bash
- Add a new element to an array without specifying the index in Bash
- How to find the difference in days between two dates?
- Lookup shell variables by name, indirectly [duplicate]
- How to assign a heredoc value to a variable in Bash?
- How do I use su to execute the rest of the bash script as that user?
- How to iterate over associative arrays in Bash
- How to replace ${} placeholders in a text file?
- Emulating a do-while loop in Bash
- How to search filenames by regex with “find”
- How do I prevent commands from showing up in Bash history?
- How to include an ‘&’ character in a bash curl statement
- Matching files with various extensions using for loop [duplicate]
- What is the name for `
- How do I echo stars (*) when reading password with `read`?
- Reading key/value parameters from a file into a shell script
- Using dot or “source” while calling another script – what is the difference?
- osascript using bash variable with a space
- Execute command containing quotes from shell variable [duplicate]
- Syntax for a single-line while loop in Bash
- How to use > in an xargs command?
- Unit testing Bash scripts
- How execute bash script line by line?
- How to update one file in a zip archive
- Store output of sed into a variable [duplicate]
- How to redirect a program that writes to tty?
- What is the proper way to test a Bash function’s return value?