選択したテキストに文字列「-----BEGINPGP MESSAGE -----」が含まれている場合は、選択したテキストを復号化します。次のコードがありますが、何も表示されません。
#!/bin/bash
xsel > pgp.txt
if [grep -e "-----BEGIN PGP MESSAGE-----" pgp.txt]
then
gnome-terminal --command "gpg -d -o decrypted.txt pgp.txt"
gedit decrypted.txt
fi
テキストを選択した後、ターミナルで実行すると、
line 3: [grep: command not found
私はbashスクリプトを初めて使用します。助けていただければ幸いです。
ありがとうございます。