[SOLVED] 3 related questions on bash command usage.
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!
Notices
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.
That indeed is the sudoers file, but don't just edit it like that. You have to use:
Code:
sudo visudo
as a user in order to edit it. To check out if you are of the admin group (which I think you are if you're the only user, and since you can use sudo), type in a terminal as your user:
Code:
id
and it'll show you all the groups and ids assigned to your user.
That indeed is the sudoers file, but don't just edit it like that. You have to use:
Code:
sudo visudo
as a user in order to edit it. To check out if you are of the admin group (which I think you are if you're the only user, and since you can use sudo), type in a terminal as your user:
Code:
id
and it'll show you all the groups and ids assigned to your user.
Kind regards,
Eric
Hello once again Eric.
"id" returns:
Code:
andrew@mylinuxbox:~$ id
uid=1000(andrew) gid=1000(andrew) groups=4(adm),20(dialout),24(cdrom),46(plugdev),104(lpadmin),115(admin),120(sambashare),1000(andrew)
Hi. I re-did the file to those specifications, and it resulted in the said flashing of the terminal with no output or action. (It flashes very fast so I can't really see if anything happened but the command "airodump-ng" should result in sustained output)
Did you still leave a
Code:
sudo su
in your script? I think it's best to leave it out of the script and just use it like this:
That did the trick. I made a GNOME menu entry and used "gksudo /home/andrew/Desktop/airodump-ng_auto" (airodump-ng_auto was my script name) and it worked like a charm.
I attached a few screenshots of the script in action!
Last edited by lupusarcanus; 03-07-2010 at 03:20 AM.
Also note that you join commands with && if you want to stop the sequence if any of the commands fail. "echo 1 && echo 2" means echo 1 and if that statement succeeds, then run the command "echo 2" and on and on any number of commands. On the other hand "echo 1 || echo 2" means run "echo 1" and then only if that fails, run "echo 2"
And if you really don't care what the return status is or the return status is undefined (unlikely on Linux but very prevalent in Windows) then just use the semicolon (";").
Last edited by vrmartin2; 01-06-2010 at 09:13 AM.
Reason: spelling correction
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.