Global - Local script??


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Global - Local script??
# 1  
Old 11-06-2010
Global - Local script??

Hi,
I have a script which can be called from any path on the machine. It kind of acts like a global script. How do I achive this? Smilie

The path from which I call it is different from the path where it exists.
(where <script name> )


Thanks and Regards,
Preetham R.
# 2  
Old 11-06-2010
Code:
$ echo "$PATH"
/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.3:/usr/games/bin
$

The PATH variable lists directories the shell will hunt inside when looking for an executable. It can vary from system to system, but nearly all paths should have /bin/ and /usr/bin. Place your script under /usr/bin/ and people should be able to use it. Or, add another path to their PATH so they can find it in some custom directory.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies

2. Solaris

Covert Global zone to local zone

Dears, I would like to convert solaris 10 x86 and solaris 10 sparc (Global Zones) physical servers into Local zones. i found a document which seems to be helpful but i'm stuck @ the 1st step. to test this i want to do it 1st on x86 system running under vmware ESXi and if it succeeds i will... (1 Reply)
Discussion started by: mduweik
1 Replies

3. HP-UX

Seeing different output from who -u in global INIT and local SRP

I am seeing different output from "who -u" when we execute "who -u" in global INIT and local SRP after calling telnet, rlogin and remsh. We are not seeing correct output when we login to local SRP using telnet, rlogin and remsh. srp_init just creates an UTMP entry in the UTMP database. Based my... (1 Reply)
Discussion started by: madhur.tripathi
1 Replies

4. Solaris

sharing a directory between local and global zone

is this the step? add fs set dir=/export set special=/export set type=lofs add options rw end i notice i can't post immediately, moderator needs to moderate. i have 1 more post still haven't appear in the forum..hmm.... (1 Reply)
Discussion started by: binary0011
1 Replies

5. Solaris

Global zone name from local zone

How to check the global zone name from local zone. (6 Replies)
Discussion started by: fugitive
6 Replies

6. Solaris

Not able to ping global zone from local zone

Hi Gurus I am not able to ping the local zone from global zone when i am trying to ping i am getting below ICMP Host Unreachable from gateway zone ( 192.268.35.210) for icmp from zone ( 192.168.35.210) to sun1 ( 192.168.35.210) However i can ping local zone from global please... (12 Replies)
Discussion started by: kumarmani
12 Replies

7. Shell Programming and Scripting

Problem with global and local variables

Guys, how can I define global variables in sorlaris...cause I lose the values outside the scope. Rite now wat I do is,I redirect variable value to a file n then get it back outside the function...:o....theres obviously a better way of doing this...I now this is a basic question....but please... (2 Replies)
Discussion started by: qzv2jm
2 Replies

8. Programming

Reg. Local vs Global declarations

Please go through the following two versions of code :- Version 1 --- string1 and string2 declared as Global variables The output is :-- (as expected sprintf is overwriting the first byte of string2 with NULL) string1=send string2= #include <stdio.h> char string1; char string2; main()... (2 Replies)
Discussion started by: kms
2 Replies

9. Shell Programming and Scripting

Global variable becomes local

I have encountered a very weird behavior of a global variable in Korn Shell in AIX: A function f1 in my script pipes the output of the function f2 to a program. A variable defined as global using typeset gets its value in f2. That value is not seen in f1. If I remove the pipe ksh recognizes the... (2 Replies)
Discussion started by: odashe318
2 Replies
Login or Register to Ask a Question