I'd like to create a cron job that periodically pings an external resource and retrieves some information on my behalf, using my username and password that I logged in to the computer with.
I could hard-code the username and password into the script, but that is a bad practice.
I could use environment variables, but then I have to hard-code the username and password into a different script, which is still a bad practice.
I could create a keychain pair for use with this process, but then when my network password changes every few months, this process is likely to keep running with the wrong password and lock out my account.
My question is: What parameters can I give to the
security command to retrieve the password that I used to log in to the machine?