--password-file works in backup mode, but failed on snapshot listing

Hi, all

i am trying to improve my restic skills with a shell script that runs automatically via cron.
At the end of the backup i want to write the files of that snapshot to a log and i am using this command line

restic ls -r $REPO --password-file $PASSWD latest >> $LOG

where $REPO is the name of the repository, $PASSWD the name of the password file and $LOG the path to the logfile. All variables contain the absolute path.

The handover of the password via file works perfectly during backup but once i fire the command above for getting the list, the command failed with that error:

Fatal: All path filters must be absolute, starting with a forward slash '/'

As it is working during backup without that error i don’t know what’s wrong.
Any ideas where my mistake is would be appreciated

EDIT: That is not a problem of the script. If i use it on the CLI and replace the variables with the values it throws the same error.

Thinking before writing could avoid stupid questions, i’ve found the problem.
the script or the command should run as sudo. And i have to call it via “sudo /full/path” and not “sudo ./relativepath”

Now it works as expected.