I have a shell script that performs pgp encryption and decryption, the encryption runs with but my decryption is failing and I do not know why. I type out the direct line and it works but fails in the script.
elif [ "$file_action" = "D" ]; then
# Use gpg to decrypt the file
gpg --decrypt $encrypted_file > $output_file
when I type this out manually it works with no issue. setting my script to set -x it displays the following:
gpg --decrypt C:encrypted.txt.gpg
the script line drops off the > output file and I cant figure out why. I have tried > and it errors and says invalid option and tried “$output_file” but it gives the dropped off result. I manually type out the line it works with no issues.
tried ">" and i tried "$output_file"
8
to set -x it displays the following:
the script line drops off the > output file
set -x
does not display >
redirections, only the command to execute.
2