- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script help
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
10-10-2001 09:49 AM
10-10-2001 09:49 AM
Here is my latest attempt:
test="abcd aa abc : rylfrer01 (xxx.xx.x.xxx) unreachable."
In my script i am trying the following
data=`echo "$test"|sed 's/.*(\: .*\ ).*/\1/'`
echo "$data"
I was hoping this would give me the text rylfrer01
Thanks for your help.
Jeff
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 09:59 AM
10-10-2001 09:59 AM
Re: script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 10:03 AM
10-10-2001 10:03 AM
Re: script help
date=`echo $test|awk'{FS=":";print $2}' |awk '{print $1}'`
This will give you rfylfer01.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 10:05 AM
10-10-2001 10:05 AM
Re: script help
by replacing date with data.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 10:07 AM
10-10-2001 10:07 AM
Re: script help
# echo $test|awk '{print $5}'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 10:08 AM
10-10-2001 10:08 AM
Re: script help
Thanks
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 10:31 AM
10-10-2001 10:31 AM
SolutionTEST="abcd aa abc: rylfrer01 (xxx.xx.x.xxxx) unreachable"
echo ${TEST} | awk '{n = split($0,arry," "); if (n > 0) { i = 1; while (i <= n) {if (match(arry[i],/ryl/) > 0) {printf("%s\n",arry[i])}; ++i }}}'
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 10:44 AM
10-10-2001 10:44 AM
Re: script help
how about plain ol' "cut"?
echo $Test | cut -d':' -f2 | cut -d'(' -f1
Just my ?0.02,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 10:55 AM
10-10-2001 10:55 AM
Re: script help
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 11:05 AM
10-10-2001 11:05 AM
Re: script help
Try this.
data=`echo $test|sed 's/^.*ryl/ryl/'` |awk "{print $1}'
if you want the entire text after ryl.., take out the awk statement.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2001 12:28 PM
10-10-2001 12:28 PM