I have a very simple script reading a text file which is in a different directory:

```
IFS=$'\n' read -d '' -r -a urls < ../dat/urls.txt

```

This works fine when running the script from the directory the script is in e.g) .`/fetch_urls`

But if I run the script from the say the user home or via cron it fails to resolve the urls.txt file. e.g.

```
/home/my-user/data-transfer/fetch_urls.sh

```

It fails with:

```
line 3: ../dat/urls.txt: No such file or directory

```

Is there some way to make it work so it always resolves correctly the urls.txt file. Or maybe I have to pass the location of urls.txt as a parameter?