how could I get process working directory


 
Thread Tools Search this Thread
Operating Systems HP-UX how could I get process working directory
# 1  
Old 05-14-2009
how could I get process working directory

how could I use c program to get HP UX process working directory
# 2  
Old 05-14-2009
Is this what is expected :-)

#include <stdio.h>

int main()
{
system("pwd");

return 0;
}
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Foreach .gz file in a directory -- Not working

Hi, I am trying to add for loop in my code for all the .gz files in a directory. example code: for i in $PWD/input/*.dz do echo " file is :: $i " done This is not working as expectation and the output is : file is :: /home/IB/input/*.dz However, for i in $PWD/input/*... (5 Replies)
Discussion started by: IB_88
5 Replies

2. Solaris

Python script not working in batch process

Good morning, I have a python 2.3 script that runs stand alone as intended when tested, then it was put into a ksh script. when running the ksh script it runs as intended. The problem is that my script does not run when the ksh script is called by another user who runs a batch process (as of right... (1 Reply)
Discussion started by: mhahe
1 Replies

3. UNIX for Dummies Questions & Answers

Current working directory

Hi all, How do I print the name of my current working directory only to screen? Not pwd! For example, if I was in /home/work I am looking for 'work' only (4 Replies)
Discussion started by: jimjam
4 Replies

4. Shell Programming and Scripting

My Script For Process Checking is NOT Working

Hello there ULF, Good day! Just want to share my code and as well as my problem on why I'm not getting the output that I want. My original code was: #!/usr/bin/sh echo echo -n "Please input an IP-Pool: " read ip echo echo "Please wait....."... (8 Replies)
Discussion started by: rymnd_12345
8 Replies

5. Shell Programming and Scripting

Crontab and working directory

Hi all I would like to crontab some python script I have. These have the task to write a txt file on the same directory where they are let' say 'scriptFolder'. When I schedule the script execution with crontab the file is printed out somewhere else. Is there any way to tell crontab that for... (2 Replies)
Discussion started by: manustone
2 Replies

6. Shell Programming and Scripting

cut the present working directory

how to traverse through each directory (1 Reply)
Discussion started by: Reddy482
1 Replies

7. UNIX for Advanced & Expert Users

commands not working if the executed from forked process

Hi, I have an application where if it runs indivisually could able to execute commands (like system("ls")) and could able to execute tcl script. Same application if started from health monitor process (From health monitor process my application will be forked), it could not execute the... (1 Reply)
Discussion started by: chandrutiptur
1 Replies

8. UNIX for Dummies Questions & Answers

working directory shown

Hi, How do I get my working directory always shown in the unix editor? i.e if I am now at /Home/abc/xyz/, I want to see this absolute path displayed ( and now only display when I type pwd). thanks for the kind help. Regrads (3 Replies)
Discussion started by: swchee
3 Replies

9. UNIX for Dummies Questions & Answers

Change to a new working directory...

I need to CD to a particular directory to check log files and interface files. Instead of typing the path manually, is there a way of getting a script to change my working directory to the one I need? Currently I have a script that CD's to the directories I need but a soon as the script exits,... (5 Replies)
Discussion started by: jagannatha
5 Replies

10. Programming

Getting present working directory

How can I get the present working directory in unix system using c programming and stored it in a string ?? (0 Replies)
Discussion started by: winsonlee
0 Replies
Login or Register to Ask a Question