Refer to te current directory in a shell script

Posted by One Two Three on Stack Overflow See other posts from Stack Overflow or by One Two Three
Published on 2012-06-05T22:36:23Z Indexed on 2012/06/05 22:40 UTC
Read the original article Hit count: 240

Filed under:

How do I refer to the current directory in a shell script

So I have this script which calls another script in the same directory

#! /bin/sh

#Call the other script
./foo.sh 

# do something ...

For this I got ./foo.sh: No such file or directory

So I changed it to:

#! /bin/sh

#Call the other script
foo.sh 

# do something ...

But this would call the foo script which is, by default, in the PATH. This is not what I want.

So the question is, what's the syntax of doing './` in a shell script?

© Stack Overflow or respective owner

Related posts about shell