HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Prompt message to a particular user terminal
Operating System - HP-UX
1829494
Members
1369
Online
109991
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
08-13-2001 06:33 AM
08-13-2001 06:33 AM
Scenario Descriptions
===============
I am required to write a shell script where it will prompt error message with a beep sound to selected user terminals when error encountered for a transfer file process using rcp command. Of course the user must log into the HP server via telnet session. If error occur in the rcp command when copying files over to a remote server, error message must be prompted to the telnet session on the particular terminal.
For example, I was given two IP addresses of the terminals to be propted with error mesage - 10.200.75.133 and 10.200.75.135.
Problem Descriptions
===============
My question is whether there is a way to detect from the HP server for these two given IP addresses to be prompted with error message when error ecountered.
I have tried using the "who" command, unfortunately it shows only the user id, tty and the date columns.
Is there a Unix command that I can grep for the terminal IP address when the user log in to the server via the terminal (10.200.75.133) as well as the user id and the tty for that session? I need to know that in order for me to use the "write" command to send a message to the user id and the tty that is using the 10.200.75.133 terminal. eg: cat msgfile.txt | write
Another problem is how should I create a beep sound when the error message is prompted onto the telnet session using the "write" command? Is there a way to create a beep sound with message on a telnet session for a specific terminal?
Please feel free to suggest if there is other better way to accomplish the above mentioned requirement. Thank you in advance!
===============
I am required to write a shell script where it will prompt error message with a beep sound to selected user terminals when error encountered for a transfer file process using rcp command. Of course the user must log into the HP server via telnet session. If error occur in the rcp command when copying files over to a remote server, error message must be prompted to the telnet session on the particular terminal.
For example, I was given two IP addresses of the terminals to be propted with error mesage - 10.200.75.133 and 10.200.75.135.
Problem Descriptions
===============
My question is whether there is a way to detect from the HP server for these two given IP addresses to be prompted with error message when error ecountered.
I have tried using the "who" command, unfortunately it shows only the user id, tty and the date columns.
Is there a Unix command that I can grep for the terminal IP address when the user log in to the server via the terminal (10.200.75.133) as well as the user id and the tty for that session? I need to know that in order for me to use the "write" command to send a message to the user id and the tty that is using the 10.200.75.133 terminal. eg: cat msgfile.txt | write
Another problem is how should I create a beep sound when the error message is prompted onto the telnet session using the "write" command? Is there a way to create a beep sound with message on a telnet session for a specific terminal?
Please feel free to suggest if there is other better way to accomplish the above mentioned requirement. Thank you in advance!
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2001 06:40 AM
08-13-2001 06:40 AM
Re: Prompt message to a particular user terminal
Hi:
'who -u' will return a broader set of information, including the IPAddress (or DNS name) of the user's telnet session.
From this you can extract (with 'cut' or 'awk') the corresponding terminal to which to issue a write.
In general, if you do the following, you can add an audible beep to a message.
# echo "hello!\007"
I'm not sure whether the 'write' will pass this alone or whether it will be dropped, but you can try it.
...JRF...
'who -u' will return a broader set of information, including the IPAddress (or DNS name) of the user's telnet session.
From this you can extract (with 'cut' or 'awk') the corresponding terminal to which to issue a write.
In general, if you do the following, you can add an audible beep to a message.
# echo "hello!\007"
I'm not sure whether the 'write' will pass this alone or whether it will be dropped, but you can try it.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2001 06:49 AM
08-13-2001 06:49 AM
Re: Prompt message to a particular user terminal
Hi Melvin,
you could try this
who -R | egrep "10.200.75.133" | awk '{print $1, $2}' | while read user terminal^Jdo^Jecho "rcp failed\007" | write $user $terminal^Jdone
To put this in a shell script
/Begin/
#!/bin/sh
who -R |egrep "10.200.75.133|10.200.75.135" | awk '{print $1, $2}' | while read user terminal
do
echo "rcp failed\007" | write user terminal
done
/END/
-HTH
I am RU
you could try this
who -R | egrep "10.200.75.133" | awk '{print $1, $2}' | while read user terminal^Jdo^Jecho "rcp failed\007" | write $user $terminal^Jdone
To put this in a shell script
/Begin/
#!/bin/sh
who -R |egrep "10.200.75.133|10.200.75.135" | awk '{print $1, $2}' | while read user terminal
do
echo "rcp failed\007" | write user terminal
done
/END/
-HTH
I am RU
They think they know but don't. At least I know I don't know - Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2001 06:50 AM
08-13-2001 06:50 AM
Solution
Hi Melvin,
you could try this
who -R | egrep "10.200.75.133" | awk '{print $1, $2}' | while read user terminal^Jdo^Jecho "rcp failed\007" | write $user $terminal^Jdone
To put this in a shell script
/Begin/
#!/bin/sh
who -R |egrep "10.200.75.133|10.200.75.135" | awk '{print $1, $2}' | while read user terminal
do
echo "rcp failed\007" | write $user $terminal
done
/END/
-HTH
I am RU
you could try this
who -R | egrep "10.200.75.133" | awk '{print $1, $2}' | while read user terminal^Jdo^Jecho "rcp failed\007" | write $user $terminal^Jdone
To put this in a shell script
/Begin/
#!/bin/sh
who -R |egrep "10.200.75.133|10.200.75.135" | awk '{print $1, $2}' | while read user terminal
do
echo "rcp failed\007" | write $user $terminal
done
/END/
-HTH
I am RU
They think they know but don't. At least I know I don't know - Socrates
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP