Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am attempting to learn how write bash scripts. I want one to ask for a specific key. For example, I want it to ask a question, then if it is like, y for yes, or n for no, it does a specific thing. I'm thinking it would be something like:
echo "Are you a boy? y/n"
then something... Please help!
Last edited by Slightly Disoriented; 11-21-2010 at 04:51 PM.
That line also needs to be changed. It should not have the $ in front of the variable. So, it should be:
The $ tells the shell that you want to substitute the value of the variable in place of the variable's name. You do not use the $ when using a statement that stores a value in the variable. For instance "var=1" or (as above) storing a user's input into the variable.
Mmmm, neither worked. At one point it worked without returning errors with:
if [ : var = "y" ]
But it acted like I didn't press the y key and just went to else.... And when I take out the $ and : it returned the same thing, I also tried removing the "" marks. I though the $ was there to declare that it was a variable, I didn't know I just reconized that it was one.