running script in any directory


 
Thread Tools Search this Thread
Operating Systems Solaris running script in any directory
# 1  
Old 10-26-2007
running script in any directory

hi im a cobol programmer but im new in unix.

I just want to know how can i run script even if it is in other directory??


Thanks,
# 2  
Old 10-26-2007
either

1. give the path to the other script eg /the/other/script

2. put the directory containing the script in the PATH variable, try "echo $PATH" to see what directories are listed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running script in crontab in a specific directory

I am trying to run a script from crontab but the entire script (which is 70+ lines) is written in bash and I need it to run from a certain directory. So when I run it manually I cd to /local/mnt/scr and then type ./reordersc and it works fine. However, I want it to run from the crontab and I... (20 Replies)
Discussion started by: newbie2010
20 Replies

2. Shell Programming and Scripting

Display current directory for a running process for script

I'm trying to create a ksh script to do the following: 1) Ask the user what process they want to search for. 2) Have the script read the input as a variable and use it to search for the process. 3) Display the current time & date, the working directory of the process, and finally display the... (6 Replies)
Discussion started by: seekryts15
6 Replies

3. Shell Programming and Scripting

Running shell script from any directory

Greetings all, We have an older environment that we are trying to bring up to par with our current Production and Test servers. We have a command on our production boxes, UniqueScriptName.sh, and we can issue that command from any directory and it works. On our older environment, our... (1 Reply)
Discussion started by: jeffs42885
1 Replies

4. UNIX for Dummies Questions & Answers

Find the directory in which a program is running

Hi, I'm wondering if this is possible. I run several FORTRAN programs in different directories that have the same name (say program_X). I use the command 'top' to find the programs running and the time taken. I'm wondering if it's possible to the directory in which these programs are... (1 Reply)
Discussion started by: lost.identity
1 Replies

5. Shell Programming and Scripting

ksh script not running in another directory on same server

I have a script that runs fine under my home directory. No syntax errors, runs and returns as expected. When I migrate the script to the UAT directories on the same server for User testing, I get a syntax error. I've checked to make sure the .profile I'm using is the same in the UAT... (1 Reply)
Discussion started by: mpflug
1 Replies

6. Shell Programming and Scripting

Rename folder/directory after running sort script

Hello, I'm trying to create a script that sorts documents by author (found in file name) and then create a directory for that author. For example, Input: John - Paper_1.txt John - Paper_2.txt Mark - Paper_1.txt Jill - Paper_1.txt Output: dir/John/Paper_1.txt dir/John/Paper_2.txt... (1 Reply)
Discussion started by: jl487
1 Replies

7. Shell Programming and Scripting

running a looping script for all files in directory

I have three different linux command scripts that I run for 20+ files in one directory. it goes like this FIRST SCRIPT: grep 'something' -w file > newfile1 . . . grep 'something -w file > newfile20 then I take all these 'newfileN' and run this: awk 'BEGIN {... (20 Replies)
Discussion started by: labrazil
20 Replies

8. Solaris

Running from Shell Vs running from RC script

Hi, i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell. How do i distinguish whether my script is run by init process or by shell?? Will the command /proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
Discussion started by: vickylife
2 Replies

9. Solaris

running sshd server from home directory without root access

Hi, I managed to install openssh from source on my home directory on a server I don't have root access to. I had problems with privilege separation because of permissions initially so I disabled it in sshd_config. But when I run sshd from where I installed it by doing ~/local/sbin/sshd, nothing at... (0 Replies)
Discussion started by: sayeo
0 Replies

10. Shell Programming and Scripting

How to know the directory of the file containing the running script?

When you run a script, how will you know the directory for the actual file that contains the script. The code should be like .Me in VB. I dont know how we do it in unix. Is it possible? (8 Replies)
Discussion started by: alestoquia
8 Replies
Login or Register to Ask a Question