Ways to run script from anywhere


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ways to run script from anywhere
# 1  
Old 02-21-2013
Ways to run script from anywhere

Hi I am trying to make my scripts to run from any directory and after some research (googling) I find there are 2 ways to do this

1. export PATH=$PATH:directory

2. create a /bin directory in your home directory and put your scripts there.

Could someone tell me the relative merits of either method or is it only a personal preference?

Thanks
# 2  
Old 02-21-2013
If you put them in ~/bin then (typically) only you have access to them.
If the scripts are part of a larger project, then segregating them into separate directories may be more convenient for distribution/backup etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

Alternate ways to use SQL query in Shell Script

Hello, A couple weeks ago I got some great help from a few of you regarding reading an sql query into a shell script. That post can be viewed here. Thanks to all who posted. The issue I have now is everytime I run the query I get the following error SP2-0027: Input is too long (> 2499... (6 Replies)
Discussion started by: bbbngowc
6 Replies

3. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

4. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

5. UNIX for Dummies Questions & Answers

Two questions. First one; What are the ways in which a program starts to run.

This is my first post here so hello everyone! I know that a command of the programs name can start a program and clicking on a icon in GUI can as well as a startup shell script but how do I educate myself of the method that starts an application? Does the GUI run a script? What are the ways/ way... (2 Replies)
Discussion started by: theKbStockpiler
2 Replies

6. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

7. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

8. UNIX for Advanced & Expert Users

script to run different shells which run different processes

Hi, Would like to ask the experts if anyone knows how to run a script like this: dtterm -title shell1 run process1 on shell1 dtterm -title shell2 run process2 on shell2 cheers! p/s: sorry if i used the wrong forum, quite concussed after watching world cup for several nights; but I... (2 Replies)
Discussion started by: mochi
2 Replies

9. Linux

Possible ways to run shell scripts on Windows

Hi all, I want to know possible ways to exceute the shell scripts on Windows environment. Please help me. Regards, Uday. (2 Replies)
Discussion started by: uday123
2 Replies
Login or Register to Ask a Question