- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to log hpterm window
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2005 08:48 PM
03-23-2005 08:48 PM
How to log hpterm window
I have this program which spawns a seperate hpterm window when I run. I wished to capture (as a log)whatever that is shown in this window..but it closes after the program completes running. the process that is run is shown as "hpterm -T Deskew -n Deskew -sb -geometry 80x20+200+387 -lf /" ==> when run "ps -ef". Do you guys know how I can solve this problem?
Best regards
Henry Chua
Have a nice long holiday!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2005 10:02 PM
03-23-2005 10:02 PM
Re: How to log hpterm window
This is an admitted guess, but I wonder if you can pop your hpterm window with the "-e script
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2005 04:36 AM
03-25-2005 04:36 AM
Re: How to log hpterm window
# ./program_name > /tmp/logfile.log 2>&1
This should redirect all the output, including errors displayed, to the logfile.
-greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2005 06:01 AM
03-25-2005 06:01 AM
Re: How to log hpterm window
# hpterm -e script /tmp/logfile.$$
This should open a logfile with a different name
everytime ($$ would be the process ID of the hpterm
that started the script).
Since you are calling this from a script, you could
generate more detail about the user who is executing
"hpterm" and add that at the top of the logfile.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2005 01:38 PM
03-27-2005 01:38 PM
Re: How to log hpterm window
Thank u for your inputs. If I were to know the PID of the spawned hpterm. Can I not used a certain script of commands to capture whatever output on it?
Possible?
Best regards
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2005 03:32 PM
03-27-2005 03:32 PM
Re: How to log hpterm window
want the PID of the spawned hpterm?
If you want it in a script running in the spawned
hpterm, then use
# echo $$
If you want it in the script in the parent shell that's
spawning the hpterm, then you need to follow
these steps (I'm not logged into a hp-ux
system now, so I can't give the exact script):
1) Get current shell pid (use "echo $$"), then open
the hpterm (with script command).
2) Run "ps -ef", grep the output for "hpterm", grep
for parent pid (found in step 1) in the Parent PID
field (use awk to print PID and PPID field only).
3) Get the PID of hpterm.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2005 04:48 PM
03-27-2005 04:48 PM
Re: How to log hpterm window
Thank u for your reponse..
What I really like to know is how can I capture whatever output that is directed to this spawned hpterm.
U see, when I start running a script, it will open a new hpterm and redirect all the output to it.. once the script finishes, the hpterm window closes too.
I have tried directing the out put by doing
./program_script >logfile 2>&1 but it gives me an error "ambiguous output redirect". So I was just thinkin if I can know the PID of this spawned hpterm; which as u know can be acquire using ps -ef, can I use any command with the PID to direct the output of the spawned hpterm to a logfile.
Thanks again for your support =)
Best regards
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2005 07:10 PM
03-27-2005 07:10 PM
Re: How to log hpterm window
Try this out.
sh -x | tee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2005 07:24 PM
03-27-2005 07:24 PM
Re: How to log hpterm window
> U see, when I start running a script, it will open
> a new hpterm and redirect all the output to it..
> once the script finishes, the hpterm window
> closes too.
Correct. But when you open the hpterm with the
following command,
# hpterm -e script /tmp/logfile
the output (i.e whatever is printed in the new
hpterm) is also stored in /tmp/logfile. (which is what
I understand you want to do). See the manpages
for "script".
# man script
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 09:00 PM
04-10-2005 09:00 PM
Re: How to log hpterm window
Maybe this can help too:
from any shell you can start the "script" utility (man script) to save all shell inputs and outputs to a file. You could call script from .profile for instance. Script will start another shell on top of the currently running shell.
Kind regards, Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2005 01:17 AM
04-11-2005 01:17 AM
Re: How to log hpterm window
hpterm -l -lf /var/tmp/hpterm.log
The -lf sets the logfile name but the -l turns on the feature.
Bill Hassell, sysadmin