2

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?

Jonathan Leffler
  • 698,132
  • 130
  • 858
  • 1,229
user3437721
  • 2,077
  • 4
  • 27
  • 56

1 Answers1

2
if [ -e encrypted.dat ]; then echo exists; else echo does not exist; fi  
balabhi
  • 631
  • 5
  • 5