![]() |
Executing scripts
Hi,
I am not a programmer. I have never written a script. I know there are tutorials on the subject and I have one bookmarked. My biggest question about scripts is where do you put them? Sometimes the documentation on Linux might say, just run this perl script, or insert my script, how is this done? Thanks in advance jonette20 |
Quote:
Code:
echo $PATHThe reason this will work, is because the PATH system variable is where the system looks for executables, or commands when you type something in. If you have a lot of your own scipts, I would suggest addign a directory, and then updating your PATH variable. In this way you keep scripts together and separate from other binary files, just so you stay organized, and you, the system admin knows where things are. Quote:
To run them, with the correct perl libs installed, just type the script name in a konsole. Of course the script permissions have to be set so your user, usually the owner, can execute them. Hope this helps. |
Some distributions make advance allowance for a ~/bin directory.
For example, in Debian the ~/.bash_profile file may have some lines in it like this: Code:
# set PATH so it includes user's private bin if it existsThen you can run any scripts that can run with just your permissions right from your home enviroment. ################################### PS: For this to work, you need to make sure that your xterm or xterminal-emulator (eg. gnome-terminal) is configured to act as a login shell -- otherwise the xterm won't read-in the .bash_profile. Another option, is to justrun the script as ~/bin/your_script, or from the home directory with ./bin/your_script, or from wherever with ~/bin ./your_script. In fact, ./your_script will work in whatever directory you have the script in (eg ~/test_directory ) |
Hi,
Thanks alot. Both of the answers were very informative and helpful. jonette20 |
| All times are GMT -5. The time now is 03:25 PM. |