I have a script to decrypt an encrypted file - but I only want to do it if the file exists.
bash -c "openssl rsautl -decrypt -inkey key.pem -in encrypted.dat -out decrypted.txt" Is there an easy way to only do this if the .dat file exists?
if [ -e encrypted.dat ]; then echo exists; else echo does not exist; fi fi marks the end of the if statement, like the then marks the start of the body of the if statement and the else marks the end of the body of the if and the start of the else clause.