ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
#!/bin/sh
# print out the date and who's logged on
date ; who ; #should print date and who is logged on.
that is the script saved as logins.sh used anjuta to write it. when i do chmod a+x logins(.sh) either way either nothing happens and errors but i still cant run it i have tried everyway i can think of to run it its supposed to run with the command logins so i thought. anyone give me a hand with this script please
in terminal i type chmod a+x logins and i get that it cant access no such file/dir and when i type chmod a+x logins.sh i end up back at a prompt so i try running it as logins and i get bash: logins: command not found or i try logins.sh i get same command not found im using gnome terminal assummming its a bash term.
If you mean you should be able to run it as "login.sh", without the "./" bit then it seems that you don't have "." (current directory) in your $PATH. If you actually mean "logins", then if you haven't got a file with that name you won't be able to run it as that.
i named it logins.sh cause i used shell script in anjuta as the file type and it added the .sh at end. ok i changed it to just "logins" its in my home dir. but i dont know how to add the . to the path.
If you have a .bash_profile file (in your home directory), there should be a line starting with "PATH=". After the last colon, just add "." (without the quotes) and save the file.
You sure the file doesn't exist? It won't show up by just doing "ls"; you'll need "ls -a" to see it. You could change /etc/profile (but you'd need to do that as root and it would be for all users).
oops yeah ls didnt find it your right ls -a did find it ok now that i know i have it do i need to be saving the scripting files there? and when you said add the "." to the end of colon did you mean in the script its self? like i said im new to this
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.