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 have developed a menu drive program in bash.Now i am gonaa try the concept further i.e. the application has its own status report login enabling the programme to run without giving operator access to shell. advancing the concept further the programme could be developed so that it is able to run with a ‘none interactive flag’ – enabling it’s execution to be automated with the resultant file e-mailed to a user perhaps once a day or once a week.
well i am completely blank with enabling programme to run without giving operator access to shell.
anyhelp to get the script code written much appreciated. Thank you
You could try making the script itself the "shell" in the passwd file (that is replace /bin/bash with the full path to the script). To do that you need to insure all the variable and paths the script needs are included in the script as it won't be running in a shell so won't inherit any of those things.
Insure the script has an interpreter line like:
at the beginning so it know to run the script as bash (or replace with your preferred shell).
Insure it has PATH= like PATH=/bin:/usr/bin:<sometotherdir>
so it knows where to find all the commands it uses. (e.g. ls, cp, more, mailx etc...). You can figure out where all the commands you use live by typing "which command". The PATH should have all directories that are used by any of the commands (but only once - you only need /bin once if both ls and cp are in /bin).
Insure it has any other variables you are relying on in the script defined if they are normally provided by .bashrc or .bash_profile (or .profile if ksh for example).
If all that doesn't work then you can just modify the .bashrc to have an "exec <script>" line at the end. This tells it to replace the current process (the shell) with the command after exec (the script).
I have found jlightner's concept very cool (I should try something like that someday), but in the current case this sounds like a job for a plain and simple cron job. No shell access, automated execution, timed as requested.