私はBashスクリプトにユーザーフレンドリーなGUIを追加できる素晴らしい小さなプログラムを見つけました。 whiptail man pageはすべてその役に立たないとすべての例を提供していないが BASHスクリプト:whiptailファイルの選択
です:whiptail
。
#! /bin/bash
# http://archives.seul.org/seul/project/Feb-1998/msg00069.html
if (whiptail --title "PPP Configuration" --backtitle "Welcome to SEUL" --yesno "
Do you want to configure your PPP connection?" 10 40)
then
echo -e "\nWell, you better get busy!\n"
elif (whiptail --title "PPP Configuration" --backtitle "Welcome to
SEUL" --yesno " Are you sure?" 7 40)
then
echo -e "\nGood, because I can't do that yet!\n"
else
echo -e "\nToo bad, I can't do that yet\n"
fi
しかし、私は実際にいくつかの古いコードを置き換えるためにです:whiptailを使用して、ファイル選択メニューを構築したいと思い、私はいくつかを持っている:私はです:whiptailを使用して、単純なはい/いいえメニューを作成しない方法を理解し、いくつかのGoogle検索を行った後異なるバックアップ/私が持っているのbashスクリプトを復元:
#!/bin/bash
#This script allows you to select a file ending in the .tgz extension (in the current directory)
echo "Please Select the RESTORE FILE you would like to restore: "
select RESTOREFILE in *.tgz; do
break #Nothing
done
echo "The Restore File you selected was: ${RESTOREFILE}"
私は、これはです:whiptailの「--menu」オプションを経由して行われなければならないと仮定し、私はそれについて移動する方法がわからないのですか? ポインタはありますか? または、私はいくつかのwhiptailの例の方向に向けることができますか?
私は私の答え(8進換算式)に小さな変更を加えました。 –