- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- help in script
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
04-18-2005 08:28 AM
04-18-2005 08:28 AM
help in script
(this not response)
rsh 172.31.199.48 grep IITT@speedy.com.ar /opt/SUNWmsgsr/log/mail.log_current|grep EA |awk '{print $12}' |sort|uniq
========================================
(using ' ' )
rsh 172.31.199.48 grep 'IITT@speedy.com.ar /opt/SUNWmsgsr/log/mail.log_current|grep EA |awk '{print $12}' |sort|uniq'
awk: syntax error near line 1
awk: illegal statement near line 1
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:38 AM
04-18-2005 08:38 AM
Re: help in script
What O/S version is the server at 172.31.199.48? And what O/S are you running from?
...Steve...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:40 AM
04-18-2005 08:40 AM
Re: help in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:43 AM
04-18-2005 08:43 AM
Re: help in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:48 AM
04-18-2005 08:48 AM
Re: help in script
Escape $12 - \$12. also sort -u is enough.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:48 AM
04-18-2005 08:48 AM
Re: help in script
Also remember to use the shift function if you are looking for over $9 items.
With the sort command you can include the -u as this is the unique flag to sort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:51 AM
04-18-2005 08:51 AM
Re: help in script
double quotes for the outside not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:52 AM
04-18-2005 08:52 AM
Re: help in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:54 AM
04-18-2005 08:54 AM
Re: help in script
in the second example, shouldn't it be 'grep ~ rather than grep 'IITT~ ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 09:05 AM
04-18-2005 09:05 AM
Re: help in script
using $12 of awk
server locally:
##grep IITT@speedy.com.ar /opt/SUNWmsgsr/log/mail.log_current |grep " EA "|awk '{print $12}'|sort -u
output:
blinker@binker.com
its work
the problem is when use rsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 09:11 AM
04-18-2005 09:11 AM
Re: help in script
rsh 172.31.199.48 'grep IIT@speedy.com.a/opt/SUNWmsgsr/log/mail.log_current |grep " EA "|awk '{print $12}'|sort -u'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 09:11 AM
04-18-2005 09:11 AM
Re: help in script
rsh 172.31.199.48 'grep IITT@speedy.com.a/opt/SUNWmsgsr/log/mail.log_current |grep " EA "|awk '{print $12}'|sort -u'
awk: syntax error near line 1
awk: illegal statement near line 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 09:42 AM
04-18-2005 09:42 AM
Re: help in script
on the first line, specify your shell (in the shebang line)
i.e.
#/bin/sh
grep `IITT@speedy.com.ar /opt/SUNWmsgsr/log/mail.log_current|grep EA |/bin/awk '{print $12}' |sort|uniq `
Note the changes in the first and last quote that I made -
anyway - chmod doit to 755 and place it on an accessible automount point, or... place it on the system.
then
rsh 172.31.199.48 -n /path_to/doit
good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 09:46 AM
04-18-2005 09:46 AM
Re: help in script
If you want to use the rsh without "doit"
surround the execute string in the single tic's (the ~` key) and let her rip - that should work for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 01:09 AM
04-19-2005 01:09 AM
Re: help in script
my log contains these data:
I need to obtain the field awk $12.
can replace "awk" by another command?
log:
19-Apr-2005 01:50:57.63 4b6f.1e14.25248 tcp_auth tcp_local EA 130 IITT@speedy.com.ar rfc822;IITT@speedy.com.ar IITT@speedy.com.ar <0IF600ECPG4IWF90@tdimso48.backend.tdata.com.ar> *IITT@speedy.com.ar
I need the field *IITT@speedy.com.ar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 01:29 AM
04-19-2005 01:29 AM
Re: help in script
rsh 10.1.1.10 -n grep IITT@speedy.com.ar /opt/SUNWmsgsr/log/mail.log_current |grep " EA "|awk '{print $14}'|sort -u
without command |sort -u
rsh 10.1.1.10 grep IITT@speedy.com.ar /opt/SUNWmsgsr/log/mail.log_current |grep " EA "|awk '{print $12}'
this works, and the answer is very fast but the result is:
*IITT@speedy.com.ar
*IITT@speedy.com.ar
*IITT@speedy.com.ar
.
.
that I can do
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 06:55 AM
04-19-2005 06:55 AM
Re: help in script
this works but the answer is very slow:
rsh 10.1.1.10 -n grep IITT@speedy.com.ar /opt/SUNWmsgsr/log/mail.log_current |grep " EA "|awk '{print $12}'|sort -u
the filed $awk is $12