shell的圖形化實現簡單示例
安裝dialog,一般Linux中都會預設安裝這個包,如果沒有可以使用yum install來做。
[root@rac1 ~]# yum install dialog
Loaded plugins: fastestmirror
Determining fastest mirrors
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
base/primary | 1.3 MB 00:01
base 3667/3667
extras | 2.1 kB 00:00
extras/primary_db | 173 kB 00:00
update | 1.9 kB 00:00
update/primary_db | 139 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package dialog.x86_64 0:1.0.20051107-1.2.2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
dialog x86_64 1.0.20051107-1.2.2 base 165 k
Transaction Summary
========================================================================================================================================================================
Install 1 Package(s)
Total download size: 165 k
Installed size: 393 k
Is this ok [y/N]: y
Downloading Packages:
dialog-1.0.20051107-1.2.2.x86_64.rpm | 165 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 5 pre-existing rpmdb problem(s), 'yum check' output follows:
PackageKit-0.5.8-13.el6.x86_64 has missing requires of PackageKit-yum = ('0', '0.5.8', '13.el6')
PackageKit-0.5.8-13.el6.x86_64 has missing requires of PackageKit-yum-plugin = ('0', '0.5.8', '13.el6')
abrt-addon-ccpp-1.1.13-4.el6.x86_64 has missing requires of yum-utils
perl-DBD-Pg-2.15.1-3.el6.x86_64 has missing requires of libpq.so.5()(64bit)
rhn-check-1.0.0-38.el6.noarch has missing requires of yum-rhn-plugin >= ('0', '0.5.3', '30')
Installing : dialog-1.0.20051107-1.2.2.x86_64 1/1
Verifying : dialog-1.0.20051107-1.2.2.x86_64 1/1
Installed:
dialog.x86_64 0:1.0.20051107-1.2.2
Complete!
安裝完成後,我們來看看效果。dialog提供的選項功能還是很豐富的,自己也學習了個皮毛,簡單show一下。-->msgbox元件
dialog --msgbox 'this is test' 50 50
dialog --title Testing --msgbox 'This is a new test by Jianrong' 10 20
--yesno元件
dialog --title "Please answer" --yesno "Do you want to have this testing " 10 20
--inputbox元件
dialog --inputbox "Enter your name" 10 20 Jianrong
--fselect元件
dialog --title "select a file " --fselect $HOME 10 20
更多的細節還有待學習提高。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23718752/viewspace-1352091/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Linux]簡單的shell實現Linux
- vue 實現原理及簡單示例實現Vue
- 簡單介紹Go 字串比較的實現示例Go字串
- android簡單的圖形特效處理Android特效
- 實現簡單的輪播圖(單張圖片、多張圖片)
- 簡單介紹shell中的curl網路請求的實現
- startViewTransition的簡單示例View
- 發現一個實現簡單地圖示註的視覺化軟體地圖視覺化
- 讓資料視覺化變得簡單 – JavaScript 圖形庫視覺化JavaScript
- 基於Python PIL實現簡單圖片格式轉化器Python
- shell script的簡單使用
- 圖片二次取樣簡單示例
- 一個小小的 Shell 管道符,內部實現可真不簡單!
- 從module的簡單實現到模組化
- 進擊的模組化+webpack的簡單實現Web
- 透過簡單示例瞭解執行緒池實現原理執行緒
- 仿鏈家地圖找房的簡單實現地圖
- 圖形介面的TCP/IP簡單通訊TCP
- Android MVP模式--簡單實用示例 BMIAndroidMVP模式
- 模擬實現簡易版shell
- 用 JavaScript 實現簡單拼圖遊戲JavaScript遊戲
- AOP的簡單實現
- 簡單的 HashMap 實現HashMap
- 實現簡單的BitMap
- ArrayList的簡單實現
- 簡單又強大的SHELL
- Java使用ObjectMapper的簡單示例JavaObjectAPP
- Go語言實現簡單的反序列化Go
- Gin與Mysql實現簡單Restful風格API實戰示例詳解PRHCMySqlRESTAPI
- shell簡單命令大全。
- 視覺化學習:如何生成簡單動畫讓圖形動起來視覺化動畫
- 簡單的實現vue原理Vue
- 簡單的實現React原理React
- java實現簡單的JDBCJavaJDBC
- hdfs file system shell的簡單使用
- java圖形驗證碼實現Java
- [譯]ViewModels:一個簡單的示例View
- 寫一個簡單的 Facade 示例
- gpt給出的operator簡單示例GPT