I use this command to check whether gpg password is valid or not:
gpg -o /dev/null --local-user $KEY_ID -as <(echo 1234)
This is a hacked command to check gpg password that I posted here. I can see that the /dev/null file permission changed from 666 to 644 and sometimes it become corrupted and some scripts are not able to write to /dev/null:
I can fix this by recreating /dev/null using the following command:
rm -f /dev/null; mknod -m 666 /dev/null c 1 3
1st question is, how do I prevent the /dev/null permission change or the file become corrupted when running the command so I don't have to manually recreate the /dev/null.
2nd question (if the 1st question does not have solution): How do I verify in bash whether the /dev/null file is corrupted or not? I want to use this method to recreate /dev/null as the last resort.
Any idea ?