Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
linux LIVES on script files, which can do SO SO SO SO SOmuch more than a pitiful batch file ever could. have a look at the bash scripting howto at tldp.org or skim though the rute guide in my signature.
I'm sure you'll see how funny that question seems to someone who knows about scripting!
that's what SH is for...just make a shell script... download a simple one and customize it, or, write the commands all on one line in bash then whenever you want to do them just push arrow up until it appears. 9 times out of ten there's already something written to do what you want...hope this helps...I'm a newbie too..
Yes, you can. First you (obviously) have to have the execute bit set on the file. (Do an ls -l to find out.) If it isn't, you'll have to do a chmod to set it. If it is set, you have to put the file in your 'path' for you to be able to execute it directly. To find out your path, type 'echo $PATH'. It will show you a list of directories where you could put it to have the shell look there first. You can add a directory to your path by editing your .bash_profile file and putting something like:
and then putting the file in the <your-dir> directory. As a side note, instead of typeing 'sh filename' to execute it, you can also type '. filename' (just a dot and then the file), and it does the same thing (as long as you're in the same dir as the file).
it is possible by changing the path, yes. but you shouldn't not *WANT* to do that. it is not the way things work. executable files are kept in /bin directories on your path somewhere. It may seem strange to suggest this, but you should do things properly, and call it in a way that may seem annoying to you, as that is the way to do it. the script file, when ready and completed would typically be put in a suitabel location.