LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Next step to make this script more efficient...? (https://www.linuxquestions.org/questions/programming-9/next-step-to-make-this-script-more-efficient-758970/)

redlinuxxx 10-01-2009 08:39 AM

Next step to make this script more efficient...?
 
I have just started learning shell scripts yestarday and want to tweak this so it automatically says yes to all questions of "are you sure?"
I understand programming concepts my problem is th syntax of shell scripting I dont know yet.

function delprog
{
program=program

echo -e "\n"
echo -n "What program to be Deleted Completely: "
read $program

sudo apt-get remove $program
sudo apt-get autoremove
}

catkin 10-01-2009 08:55 AM

Use apt-get's -y, --yes or --assume-yes option. It is detailed in the apt-get man page.

redlinuxxx 10-01-2009 09:42 AM

Thanks I dont no why I didnt know that was there I looked through the apt man pages before that definitely did the trick.


All times are GMT -5. The time now is 01:02 AM.