So I have one bash script that calls another bash script. The second script is in a different folder.
script1.sh: "some_other_folder/script2.sh"
In this second script, it has the line src=$(pwd) , and since I call it a script from another script in another directory, $(pwd) returns the current directory of the first script.
Is there a way to get the current directory of the second script using a simple command inside the script without having to pass a parameter?
Thanks.
source share