skip to Main Content

Trying to run .sh file. with --password "~/RPI.filename"in it. Should read the filename but getting an error. Even though the file exists

error:

Fatal: Failed to read password file: open ~/RPI/filename.sec: no such file or directory

list of directories and files:

~/RPI$ l
g.json  m1/  m2/  filename.sec  startm1.sh*

I have used it before and I know the method works but no idea what on earth is happening here.

2

Answers


  1. Maybe your script is running in sh instead of bash ? I think "~" is bash syntax.

    Login or Signup to reply.
  2. There are 1½ issues here…

    First, quoting a tilde prevents tilde expansion; compare ls ~/RPI.filename and ls "~/RPI.filename"

    => leave the tilde unquoted if you don’t want a literal ‘~’

    Second, is it ~/RPI.filename or ~/RPI/filename?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search