running a command without having to provide the path


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting running a command without having to provide the path
# 1  
Old 12-28-2006
running a command without having to provide the path

ok,

i am aware of adding the directory where the files are located into the .profile file but the problem is, its not working for me.


can someone please spell out how to properly edit these configuration files so i can run a command anywhere on the system without having to be in the directory the command is located in?


please help


thanks
Terrible
# 2  
Old 12-28-2006
export path of the directory in your .profile

like export PATH=$PATH:You path which you want to execute
e.g. export PATH=$PATH:\var\home\etc

now you could execute any script which is there in \var\home\etc from any where.

--Manish
# 3  
Old 12-28-2006
Quote:
Originally Posted by Manish Jha
export path of the directory in your .profile

like export PATH=$PATH:You path which you want to execute
e.g. export PATH=$PATH:\var\home\etc

now you could execute any script which is there in \var\home\etc from any where.

--Manish
In case there's some confusion, you probably want forward slashes like:
export PATH=$PATH:/var/home/etc

Another note, /var/home/etc seems like a strange place to put executables. /etc is where config files reside.
Kent
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Using tee command with ablity to provide input for prompts

OS version: RHEL 7.4 Shell : bash I would like to capture command outputs using tee like # yum upgrade | tee yumupgradeLog But, if I use tee command, I cannot respond to prompts like Is this ok : during command execution as shown below. Is there a way I could use tee and still be able to... (4 Replies)
Discussion started by: kraljic
4 Replies

2. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

3. Linux

Cmd is not running , eventhough its in right path

I can not run iwmodelc from command line. It says file not found. Please look at the command line output below-ksh: /app/Autonomy/Interwoven/TeamSite/bin: cannot execute $ pwd /app/Autonomy/Interwoven/TeamSite/bin $ ls email_to.ipl iwfilestate iwrecentusers iwabort ... (2 Replies)
Discussion started by: paramshamnani
2 Replies

4. Red Hat

Does RHEL 5 provide a command to collect RHEL system log in single compress file?

Hi, I heard a command that can collect all RHEL 5 log in a single compress file before I forget. Does any body know...What the command is ? Thanks. (4 Replies)
Discussion started by: nnnnnnine
4 Replies

5. HP-UX

upgrade path for Digital Alphastation 200 running openVMS 6.1?

I am not sure here is the right place to post this question. as openvms is under HP's belt now, i guess here might be the right place to try my luck. we have very old machines here which are still running quite well. (APLHASTATION 200 WITH OPENVMS 6.1) the only problem is difficulty of... (2 Replies)
Discussion started by: Cheong
2 Replies

6. UNIX for Dummies Questions & Answers

running script without a path

can someone tell me how could I run a script in an environment that does not include a path? like the environment provided by cron? (1 Reply)
Discussion started by: ikeQ
1 Replies

7. Programming

get the path of current running program

How does the program know the full path of itself when the program is running in certain diretory? BTW, I have no "argv" information of main() functino. (The program is written in C++ on linux platform) (1 Reply)
Discussion started by: princelinux
1 Replies

8. Shell Programming and Scripting

path of the running script

Hi there, After reading a couple posts on the subject, I came up with the compilation of all advice (that are supposed to work on any situation) and wrote the following script. But tell me something... Is it that crazy that there's no other way to get the same solution!!! #!/bin/bash... (27 Replies)
Discussion started by: chebarbudo
27 Replies

9. Shell Programming and Scripting

Finding path of a running script

Hi, I just want to know any code by which i can get the path of the script which i am running. This is required to store the output in the same directory from where the script is running. pwd fails if I give absolute path of script from some other directory. Thanks in advance Puneet (3 Replies)
Discussion started by: puneet
3 Replies

10. Programming

find the fully-qualified path for the app my module is running in

Hi- I need the cpp call that will tell me the full path to the app I'm running in. For example, I'm running in a loaded library for either mozilla or firefox, but would like to know the full path to the executable /usr/bin/firefox /usr/bin/mozilla /usr/local/firefox1_5 etc... (For... (4 Replies)
Discussion started by: erwinfletch
4 Replies
Login or Register to Ask a Question