nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

looking for a unix command for hpux - watch

This is a discussion on looking for a unix command for hpux - watch within the HP-UX forums, part of the UNIX operating systems category; watch is a common linux command that executes a program periodically, showing output fullscreen. I couldn't find anything for hpux, ...


Go Back   nixCraft Linux Forum > UNIX operating systems > HP-UX

Linux answers from nixCraft.


HP-UX Discussions of HP-UX UNIX operating system.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-12-2009, 11:13 PM
Junior Member
User
 
Join Date: Aug 2009
OS: Ubuntu/HPUX/AIX
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mr_manny is on a distinguished road
Default looking for a unix command for hpux - watch

watch is a common linux command that executes a program periodically, showing output fullscreen.

I couldn't find anything for hpux, so I created the following shell which the user is testing:

cat /usr/bin/watch
Code:
#!/bin/sh

while [ 1 ] ; do
clear
echo "Command: $*"
date
echo ""
( $* )
sleep 10
done
is anyone aware of where I could find "watch" or anything equivalent for hpux?

thanks and hh,
manny

Last edited by nixcraft; 22-12-2009 at 11:38 PM.
Reply With Quote
  #2 (permalink)  
Old 22-12-2009, 11:41 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

watch is GNU utility and is part of procps package. You can download source from the Internet and see if you can compile it locally.
procps - Downloads
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 23-12-2009, 03:11 AM
Junior Member
User
 
Join Date: Aug 2009
OS: Ubuntu/HPUX/AIX
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mr_manny is on a distinguished road
Default

thanks for the info...any compile notes you wish to share?

thanks in advance,
manny
Reply With Quote
  #4 (permalink)  
Old 23-12-2009, 07:18 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

First, you need HPUX compiler and libraries installed. You also need libncurses developer libs. Untar the downloaded tar ball.
cd to new directory and type make
Code:
make
OR
Code:
make watch
O/P


Code:
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s -m64 -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -c -o watch.o watch.c
watch.c: In function ‘main’:
watch.c:255: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result
cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s -m64 -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions watch.o -Wl,-warn-common  -o watch -lncurses
Run it:
Code:
./watch
O/p
Code:
Usage: ./watch [-dhntv] [--differences[=cumulative]] [--help] [--interval=<n>] [--no-title] [--version] <command>
I'm not sure this will work under HP-UX as they have propitiatory kernel, libs and interfaces. But give it a try...

HTH
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 23-12-2009, 07:24 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Alternatily, take a look a the following url. It has Open Source Software packages ported to HP-UX. Try searching
Porting And Archive Centre For HP-UX
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply

Tags
hpux , hpux watch command , shell scripting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
unix ls command raj Getting started tutorials 2 20-08-2009 03:44 PM
unix find out ram usage command charvi Solaris/OpenSolaris 4 10-04-2008 02:22 AM
HPUX Unix comparing 2 large files line by line raj HP-UX 1 11-02-2008 05:20 PM
UNIX and Linux command for DNS chiku Getting started tutorials 1 29-04-2007 04:36 PM
How to watch television on Linux computer tom Getting started tutorials 0 08-12-2005 12:46 PM


All times are GMT +5.5. The time now is 12:19 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38