- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to check all modems
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
09-09-2004 12:52 AM
09-09-2004 12:52 AM
script to check all modems
for i in `cat /etc/uucp/Devices | grep ^Dire | awk '{print $2}'`
do
echo $i
cu -l${i} dir << EOF
AT
~.
EOF
done
Dosent give me the expected results (my expectations). Thanks for any help you may give me.
Todd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 02:00 AM
09-09-2004 02:00 AM
Re: script to check all modems
I think you wanted the $2 to remain literal for the awk command. Try changing it to {print \$2}.
By the way you can rework that for statement like this and remove all the unnecessary pipes-
for i in `awk '/^Dire/{print \$2}' /etc/uucp/Devices`
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 02:21 AM
09-09-2004 02:21 AM
Re: script to check all modems
I still get the same outcome. I know I have about 7 modems that I should see a lost carrier and I dont. It does issue the ~. at the end and disconnects from the modem. Im just not seeing the AT command being executed, which should be followed by a OK.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 02:45 AM
09-09-2004 02:45 AM
Re: script to check all modems
Why are trying ~. to disconnect the connection with EOF
On hard-wired lines, ~. sends several EOF characters to log out the session
Try to to use as,
~.. to suppress EOF actions, so that EOF after ~.. will get effect.
So try to use as,
for i in `awk '/^Dire/{ print $2 }' /etc/uucp/Devices`
do
echo $i
cu -l${i} dir <<-EOF
AT
~..
EOF
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 03:32 AM
09-09-2004 03:32 AM
Re: script to check all modems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 03:35 AM
09-09-2004 03:35 AM
Re: script to check all modems
Have you tried breaking the script down? What happens if you just have the here script for cu with a fixed device name? Also, do you have a shell definition as the 1st line of the script?
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 03:42 AM
09-09-2004 03:42 AM
Re: script to check all modems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 03:52 AM
09-09-2004 03:52 AM
Re: script to check all modems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 03:56 AM
09-09-2004 03:56 AM
Re: script to check all modems
To run "cu" you may have to drive it with a "expect" script.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 04:06 AM
09-09-2004 04:06 AM