Alternate for pwdx in HPUX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Alternate for pwdx in HPUX
# 1  
Old 06-01-2012
Alternate for pwdx in HPUX

I need alternate command as pwdx does not work on

Code:
HP-UX mymachine B.11.31 U ia64 3223107173 unlimited-user license

# 2  
Old 06-01-2012
pwdx is a linux command I doubt it exist under HP-UX or AIX ( up to 6.1...), solaris 10 has something though...
# 3  
Old 06-01-2012
Error

Quote:
Originally Posted by vbe
pwdx is a linux command I doubt it exist under HP-UX or AIX ( up to 6.1...), solaris 10 has something though...

Can you design any script for HPUX or any tool with a similar functionality as I am habitual to using it.
# 4  
Old 06-01-2012
hpux doesn't even have /proc, so getting that kind of information from the outside is difficult. At a glance, not even pstat has that info available, though I don't have an HP-UX machine to check. You might be able to play with ps options.

I don't think using pwdx was a good habit to have gotten into, honestly. What functionality do you need it for? Usually those sorts of paths are supposed to be defined, not inferred.
# 5  
Old 06-02-2012
This should produce similar results on HPUX with lsof installed
Code:
lsof -p 2912 | awk '$4 == "cwd"'

---------- Post updated at 01:25 AM ---------- Previous update was at 01:25 AM ----------

This should produce similar results on HPUX with lsof installed
Code:
lsof -p 2912 | awk '$4 == "cwd"'

This User Gave Thanks to Peasant For This Post:
# 6  
Old 06-13-2012
I get an output as below.

Code:
==> lsof -p 11467 | awk '$4 == "cwd"'
java_q4p 11467  bea  cwd    DIR           2,0xc351       8192    11238 /opt/app/bea/user_projects/domains/base_domain

Can you please explain me the significance of your command below ?

Code:
awk '$4 == "cwd"'

# 7  
Old 06-13-2012
If the field 4 of the lsof -p pidoutput is cwd, print that line.
Using awk instead of grep, since it will limit the search on only forth field.

cwd is current working directory, for more info consult lsof manual.

Hope that helps
Regards
Peasant.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

The Alternate DC board for AudioScope.sh.

Hi guys... Well I have entered an area of partial insnity... ;o) Below is a photo of the 'ALTDC' board for AudioScope.sh... I have decided to incorporate all three methods for obtaining DC into this MBP via the MIC input. 1) VFO. 2) CHOPPER. 3) COUNTER. The controller for the COUNTER... (9 Replies)
Discussion started by: wisecracker
9 Replies

2. Shell Programming and Scripting

Alternate for sed -i in AIX

Experts, At the moment I am working in AIX box where sed -i is not available. My requirement is as below Two files file1 and file2. file1 contains the IP address, its count. file2 contains the Hostname and its corresponding IP address. I would like get the IP address replaced with the apt... (7 Replies)
Discussion started by: sathyaonnuix
7 Replies

3. HP-UX

Alternate for wget

Hi, Whats the alternate for wget in HP-UX ? (4 Replies)
Discussion started by: mohtashims
4 Replies

4. HP-UX

pwage-hpux-T for Trusted HPUX servers

I'm sharing this in case anybody needs it. Modified from the original solaris pwage script. This modified hpux script will check /etc/password file on hpux trusted systems search /tcb and grep the required u_succhg field. Calculate days to expiry and notify users via email. original solaris... (2 Replies)
Discussion started by: sparcguy
2 Replies

5. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies

6. HP-UX

pwdx equivalent on HP

In sun solaris, pwdx will give the print working directory. Suppose I have 5 databases running on different oracle versions. If I want to know what database is running on what oracle version, I just give pwdx <process id>. It will show the oracle home details. Could you give me the... (10 Replies)
Discussion started by: oracleuser
10 Replies

7. Shell Programming and Scripting

alternate lines

Hi, I'm new to Unix. I want to read the all the lines from a text file and write the alternate lines into another file. Please give me a shell script solution. file1 ----- one two three four five six seven newfile(it should contain the alternate lines from the file1) ------- one... (6 Replies)
Discussion started by: pstanand
6 Replies

8. Shell Programming and Scripting

Alternate way for echo.

Hi, Is there any other command echo does. if I am doing this operation for each line in my file. So its taking very long time to process more than 1000 records. Is there any alternative way to write the above if statement (5 Replies)
Discussion started by: senthil_is
5 Replies

9. UNIX for Advanced & Expert Users

Alternate to pinging boxes

Hello, We have boxes on a WAN network I guess you would call it, pretty much they are hooked up via DSL in different locations in the US and we connect to them via SSH for a secure connection. Some of the boxes won't return a ping request like they are down, I am guessing is because the router... (5 Replies)
Discussion started by: benefactr
5 Replies

10. Shell Programming and Scripting

Cronjob on alternate sundays

I want to set the crontab job for one of my SIEBEL database to refresh it on alternate sundays. Is there anyway I can do it through cron please ? If not whats the alternative ? :confused: Thanks in advance. (6 Replies)
Discussion started by: abhi123
6 Replies
Login or Register to Ask a Question