vendredi 30 janvier 2015

Questions about whiptail and bash functions


I'm a bash newbie.



  • How to make whiptail full terminal screen? "as big as the terminal", like fluid CSS

  • Say I have this script




#!/bin/bash

function cpp-lang {
yum install "Development Tools"
}
function updatesys {
yum -y update yum -y upgrade
}

whiptail --checklist "test" 5 40 5\
Update "Update the system" on \
C++ "Install C++" off 2>results

while read choice
do
case $choice in
Update )updatesys
;;
C++)cpp-lang
;;
*)
;;
esac
done < results


When I run it, it exists, should I return something from the function?



  • Considering the script above as an example, should I run sudo everytime I call yum install or is doing sudo ./script.shenough?



Aucun commentaire:

Enregistrer un commentaire