1
當以圖形方式啓動時(通過雙擊腳本圖標並選擇運行),此腳本無法正常運行,但如果從終端調用則運行得很好;不會保存文件或從現有文件加載內容。請幫忙!謝謝。當在終端外運行時,Bash腳本不工作
#!/bin/bash
# This script provides a simple and secure messaging system for users not
# familiar with gpg or using the terminal. The idea is to keep sensitive
# plaintext files off one's computer.
zenity --question --text="Select operation:" --ok-label="Compose" --cancel-label="Read"
if [[ $? == 0 ]]; then
usr=$(zenity --entry --text="Sender Key ID:")
rec=$(zenity --entry --text="Recipient Key ID:")
pwd=$(zenity --password)
outfile=$(zenity --file-selection --save --confirm-overwrite)
zenity --text-info --editable | gpg -aseu $usr -r $rec --passphrase $pwd --cipher-algo AES256 -o $outfile
else
infile=$(zenity --file-selection)
pwd=$(zenity --password)
gpg -d --passphrase $pwd $infile | zenity --text-info --height=600 --width=800
fi
來吧,你現在應該知道「不能正常工作」並不是一種診斷... –
對不起,我週二沒有讀過頭腦。你必須實際告訴我們什麼不起作用。 – cledoux
對不起。如果腳本通過雙擊運行,然後選擇運行,它將執行,但不會保存文件或從現有文件加載內容。 – Sharon