GB | BIG5
|
| 首頁 > 編程技術 > 其它 > 正文 |
 |
| Linux程式設計-18.Dialog (11)配合Shell Script進階使用 |
| http://www.openchess.org/noitatsko/programming/ (2001-05-27 11:00:00) |
配合Shell Script進階使用
單單知道每個功能如何使用是還不夠的,一般您要需要知道如何配合Script來使用。
會需要互動的有yesno、inputbox、menu、checklist、radiolist、gauge。
yesno
例
#!/bin/sh
DIALOG=dialog
if $DIALOG --title "WCW v.s. NWO" --backtitle "Wrestling"\
--yesno "Are you ready to rumble?" 5 60; then
echo "Yeahhhhh"
else
echo "Nap..."
fi
inputbox
例
#!/bin/sh
DIALOG=dialog
if $DIALOG --title "The future is here" \
--inputbox "Where do you want to go tomorrow?" \
10 75 "Penguin" 2>my_own_destiny
then
way=`cat my_own_destiny`
echo "My way is $way"
else
echo "freak out"
fi
menu
#!/bin/sh
if dialog --title "title" \
--menu "MENU" 20 60 14 \
tag1 "item1" tag2 "item2" 2>select
then
selection=`cat select`
echo "my selection is $selection"
else
echo "go"
fi
checklist
#!/bin/sh
if dialog --title "title" \
--checklist "checklist" 20 60 14 \
tag1 "item1" on tag2 "item2" off 2>select
then
selections=`cat select`
echo "My selections are:"
for i in $selections ; do
echo $i
done
else
echo "go"
fi
radiolist
#!/bin/sh
if dialog --title "title" \
--radiolist "checklist" 20 60 14 \
tag1 "item1" on tag2 "item2" off 2>select
then
selection=`cat select`
echo "My selection is $selection"
else
echo "go"
fi
gauge
到目前為止,gauge似乎都一直有點問題,文件上也寫說是有點問題,所附的例程式也是無法使用,不建議您使用(我自己也玩不出來,你如果有試出來,請來信告訴我)。
(http://www.fanqiang.com)
進入【UNIX論壇】
|
|
| 相關文章 |
Linux程式設計-31.工作群資訊管理(grp) (2001-05-27 22:08:00) Linux程式設計-30.使用者資訊管理(pwd) (2001-05-27 21:04:00) Linux程式設計-29.時間處理 (2001-05-27 20:10:01) Linux程式設計-28.GNU Make (2001-05-27 19:00:00) Linux程式設計-27.GNU Debugger (2001-05-27 18:08:01) Linux程式設計-26.PIPE (2001-05-27 17:04:00) Linux程式設計-25.Message Queues (2001-05-27 16:10:00) Linux程式設計-24.Semaphores (2001-05-27 15:00:00) Linux程式設計-23.共享記憶體(Shared Memory) (2001-05-27 14:08:00) Linux程式設計-20.getopt (2001-05-27 13:04:00)
|
===更多相關=== |
|
|
 |
★ 樊強制作 歡迎分享 ★ |