You can use the .netrc file but be aware this is a security risk. It contains the password for the dav account with no encryption. Some of the precautions you need to use are:
- Don't use the password for this anywhere else.
- Set the .netrc file permissions 400 or 600 and owned by the user running cadaver. Use
- If possible have the cadaver program run as its own user that only runs the script.
Here is the info for netrc from the cadaver man page.
THE .netrc FILE
The file ~/.netrc may be used to automatically login to a server
requiring authentication. The following tokens (separated by
spaces, tabs or newlines) may be used:
machine host
Identify a remote machine host which is compared with the
hostname given on the command line or as an argument to
the open command. Any subsequent tokens up to the end of
file or the next machine or default token are associated
with this entry.
default
This is equivalent to the machine token but matches any
hostname. Only one default token may be used and it must
be after all machine tokens.
login username
Specifies the username to use when logging in to the
remote machine.
password string
passwd string
Specifies the password to use when logging in to the
remote machine.
Any other tokens (as described in ftp(1)) are ignored.
Good luck,
Rik