08-19-2008
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
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Folks,
In a Unix (ksh) script, is there a way to determine the current working directory path of another logged-in user? Of course, I can use "pwd" to find my own path. But, how do I find it for another active user?
Thanks for any input you can provide. LY (6 Replies)
Discussion started by: liteyear18
6 Replies
2. IP Networking
How to retrieve the path of Java bin directory in AIX (or any unix OS)??
Actually my problem is,
I have a jar file called App.jar. I want to execute it by calling the javaw executable.
My command is "/usr/java130/javaw -jar App.jar".
I've written this command into a shell script. Now,... (2 Replies)
Discussion started by: fermisoft
2 Replies
3. Shell Programming and Scripting
I have to relatively get the path of a file to use it in the script.
The directory structure is /export/opt/XTools/ and under this there are several version directories - 1.0_A0, 1.0_A1, 1.0_A2 etc.,. The actual file is under these directories: installscript.sh
My script should pickup the... (4 Replies)
Discussion started by: chiru_h
4 Replies
4. UNIX for Dummies Questions & Answers
I have a file that has multiple entries within the Unix system. Korn shell scripts are calling this file (also a ksh) with a . in front of it, and I'm trying to determine which file it is using based on the $PATH by finding where it is located first.
Any suggestion on how to go about this?... (2 Replies)
Discussion started by: gavineq
2 Replies
5. Shell Programming and Scripting
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
6. UNIX for Dummies Questions & Answers
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
Hi All,
I have a c program called findPath.c in a path /home/harsh/c-Programs/. How can i find the path where the program is stored at runtime?? I have given the following
#include<stdio.h>
int main()
{
system("dirname $0");
return 0;
}
This is resulting in the output as
.
<single dot... (6 Replies)
Discussion started by: sreeharshasn
6 Replies
8. Shell Programming and Scripting
Hi All,
I have a list of data in the listing file and I run row by row to process the record, but how to identify what is the current process line number ?
Thanks. (2 Replies)
Discussion started by: ckwan
2 Replies
9. Shell Programming and Scripting
I am trying to put together a script to find a requested script or program on the user's search path. Am trying to replace the colons separating the parts of a path with a newline to let xargs pass the directories to a list command, but I haven't gotten that far. This is my progress:
echo... (7 Replies)
Discussion started by: wbport
7 Replies
10. Solaris
Hi all,
Recently i wanted to see if i have openssl installed in my system (solaris 10), so i do this (not sure if this is the right way to do this)
pkginfo -i | grep -i "ssl"
system SUNWopenssl-commands OpenSSL Commands (Usr)
system SUNWopenssl-include ... (3 Replies)
Discussion started by: javanoob
3 Replies