Advertisement
Angelim

subshell

Aug 17th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.00 KB | None | 0 0
  1. #!/bin/bash
  2. #source  /root/labman/usr/bin/labmanager funcoes
  3. #coproc export_var  {  while read variable ;do echo $variable ;done }
  4. function getUser_ ()
  5. {
  6.   user_arr[0]=$(yad --button="Exit":1 \
  7.                     --button="OK":0 \
  8.                     --title="$FUNCAO" \
  9.                     --entry \
  10.                     --entry-label="User: " \
  11.                     --entry-text="${user_arr[0]:-name}")
  12. }
  13.  
  14. function delUser_ ()
  15. {
  16.   local FUNCAO="Remover usuário"
  17.   echo "# Execultando : $FUNCAO"
  18.   while [ ${user_arr[0]:-name} = 'name' ];
  19.   do
  20.     if ! getUser_;then
  21.        exit 1
  22.     fi
  23.   done
  24. #        delusuario ${user_arr[0]}
  25. #        loop "$USERDEL"
  26. #        unset FUNCAO
  27. }
  28.  
  29.  
  30.  
  31. function menu_ ()
  32. {
  33.  case ${1,,} in
  34.         remover)  delUser_ ;;
  35.  esac
  36. }
  37.  
  38.  
  39. export -f menu_ delUser_ getUser_
  40. yad     --title="LabManager - Principal" \
  41.         --image="./f13_logo1.png" \
  42.         --width="350" \
  43.         --height="150" \
  44.         --button="Sair:1" \
  45.         --fixed \
  46.         --form  \
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement