LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-01-2009, 09:39 AM   #1
redlinuxxx
LQ Newbie
 
Registered: Sep 2009
Location: Seaside Heights
Distribution: Debian Slimed Down :)
Posts: 26

Rep: Reputation: 15
Lightbulb 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
}
 
Old 10-01-2009, 09:55 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Use apt-get's -y, --yes or --assume-yes option. It is detailed in the apt-get man page.
 
Old 10-01-2009, 10:42 AM   #3
redlinuxxx
LQ Newbie
 
Registered: Sep 2009
Location: Seaside Heights
Distribution: Debian Slimed Down :)
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks I dont no why I didnt know that was there I looked through the apt man pages before that definitely did the trick.
 
  


Reply

Tags
shell script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS Step 6.7 - make headers_check fails ice13berg Linux From Scratch 7 01-07-2011 10:05 AM
Step by Step way to make SUSE 9.3 VMWARE ready ?? my-unix-dream Linux - Newbie 5 07-05-2005 10:18 PM
Step-by-step procedure to make a Live CD? kRu_ZaDeR Linux - General 3 03-28-2003 10:34 PM
help this to make this sed efficient plz doublefailure Programming 1 03-25-2002 07:57 AM
Any1 please make a step by step install of RH7.1 Simsala Linux - Software 5 08-17-2001 07:01 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration