I'm trying to iterate over a list of files in a directory, encrypt them, and move them somewhere else using bash. Here is what I have so far:
for filename in /home/anthony/documents_preprocessed; do
gpg --encrypt --recipient anthony@mydomain.org $filename
mv /home/anthony/$filename /home/anthony/Documents
done
As I understand it, this should work but I'm fairly new to bash scripting. When I run this, it never encrypts and it just moves the file to the documents directory.
Can anyone tell me what the correct way of doing this is?
Thanks!