Shell script current directory?

后端 未结 5 1716
一生所求
一生所求 2020-12-23 16:18

What is current directory of shell script? I this current directory from which I called it? Or this directory where script located?

5条回答
  •  甜味超标
    2020-12-23 16:52

    You could do this yourself by checking the output from pwd when running it. This will print the directory you are currently in. Not the script.

    If your script does not switch directories, it'll print the directory you ran it from.

提交回复
热议问题