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).
I want to know from which directory the script was executed.
– Rajan Sharma Jun 18 '19 at 08:54yes exactly... I need a command to use outside of the script.
– Rajan Sharma Jun 18 '19 at 11:17$pwd
in my script" the first thought is you want to use something else in the script. – Kamil Maciorowski Jun 18 '19 at 11:25