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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is a very simple problem, but i'm scratching my head with others..
In composing a simple shell script in class, we can't seem to get the script to execute fully. script was formatted as follows.
#!/bin/bash
echo "good bye for now"
exit
did, Chmod 755 to make executable
type file name "bye"
runs but wont exit.....
it just echos the type"good bye for now
The instructor says it works for him at home....
But it wont work in class...
Is there a reason it wont "exit" the shell as commanded ?????
we are using putty with bash shell Linux.
Last edited by twrig3846; 02-09-2010 at 09:27 PM.
Reason: wrong chmod code
Yes it appears to echo good bye and returns to the shell prompt, the
instructor leads me to believe that this script should run and leave you
exiting the Linux program and exits back to windows, I seem to be missing
something somewhere...
When I type in the filename which is "bye" He says this should leave the Linux completely after saying "goodbye" or rather typing it.and cause you to exit as if you typed "exit" and hit enter.
c:~$ echo '#!/bin/bash
> echo "good bye for now"
> exit' > /tmp/bye.sh
c:~$ chmod +x /tmp/bye.sh
c:~$ /tmp/bye.sh
good bye for now
c:~$
What are you doing different?
I don't seem to be doing anything different, Maybe he is just testing us.
his statement was "does it work or not" if not why? and if so why?
maybe I'm chasing my tail, I know the exit command works if I'm not in the directory he tells us to be in so maybe that's my clue.
He starts us out by making a directory named bin in our home directory and in this directory to make a file named bye and to make this file executable and run this bye script.......this is where I'm at....????
I know I'm still a newbie and am learning all the time..Thanks to all who helped me out tonight, You have been a great help..I thought all along that this was the case but was expected to find my own answer.. The KW book and the SKS are very vague in some explanations...Thank You
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.