Sample Header Ad - 728x90

Questions about whiptail and bash functions

2 votes
1 answer
1439 views
- 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 exits, should I return something from the function? - Considering the script above as an example, should I run sudo every time I call yum install or is doing sudo ./script.shenough?
Asked by Lynob (4434 rep)
Jan 30, 2015, 02:22 PM
Last activity: Aug 21, 2018, 12:37 AM