This question already has an answer here:
suppose there is a script "/home/abc/test.go". Someone else went to another directory lets assume "/etc/random/" and executed the script "test.go".
Now I want to know from where the script was invoked.
Can anyone help me with the command to know from where the script was invoked(/etc/random/)??
I tried "lsof" but it gives the files that the script is working on and the location of the script(/home/abc/) but not from where it is invoked.
Note:- I don't want to use $pwd in the script. I am looking for a command that can just display the directory from where the mentioned script was executed(invoked).