1. echo 'if U try run this script must need dialog this programs' 
  2. yum -y install dialog 
  3.  
  4. DIA='/usr/bin/dialog' 
  5. i="/tmp/inputbox.$$" 
  6.  
  7.  
  8.  
  9.  
  10. dialog --inputbox "请输入用户名" 20 60  2> $i 
  11.  
  12. USER=$(cat $i) 
  13.  
  14.  
  15. if grep -q ^$USER /etc/passwd 
  16.         then 
  17. dialog --msgbox "账户存在" 20 60 
  18.  
  19. dialog --msgbox "$USER 账户基本信息是 `id $USER`" 20 60 
  20. rm -rf $i 
  21.         else 
  22. dialog --msgbox "$USER 帐号不存在" 20 60 
  23. rm -rf $i 
  24. fi