- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- mailx: deleted 251 NULL characters in mail file ER...
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-14-2011 02:27 AM
10-14-2011 02:27 AM
Hi All
I have the following script:
#!/usr/bin/ksh
if (grep -E 'Year' /tmp/fr/prep03.280111)
then
mailx -s "Error from log" fxxx@yyy.com < /tmp/fr/prep03.280111
fi
The idea is to mail me the all lines containing that string "Year" on that file
But I am having the following error:
Year 2000 patches (ONLY for OS !!!!)
Year 2000 patches (ONLY for HP-UX Application !!!!)
mailx: deleted 251 NULL characters in mail file
FR
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 02:38 AM
10-14-2011 02:38 AM
Re: mailx: deleted 251 NULL characters in mail file ERROR
There is no need for -E if you just want "Year".
>But I am having the following error:
What error? Your input file seems to have NULs in it. You can ignore it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 02:43 AM
10-14-2011 02:43 AM
Re: mailx: deleted 251 NULL characters in mail file ERROR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 02:50 AM - edited 10-14-2011 02:51 AM
10-14-2011 02:50 AM - edited 10-14-2011 02:51 AM
Solution>I just want the all line containing that word "Year"
Then you need to redo the grep or save the file:
if grep -q 'Year' /tmp/fr/prep03.280111; then
grep 'Year' /tmp/fr/prep03.280111 | mailx -s "Error from log" fxxx@yyy.com
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 03:00 AM
10-14-2011 03:00 AM
Re: mailx: deleted 251 NULL characters in mail file ERROR
NIS map mail.aliases specified, but NIS not running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 03:10 AM
10-14-2011 03:10 AM
Re: mailx: deleted 251 NULL characters in mail file ERROR
Hi Dennis!
It does work fine, but if I wanted to change to only search that word in the last 200 lines of the file... otherwise it will be repeating the sending the same lines again and again...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 03:21 AM
10-14-2011 03:21 AM
Re: mailx: deleted 251 NULL characters in mail file ERROR
>but if I wanted to change to only search that word in the last 200 lines of the file
TMP=/tmp/fr/last.$$
tail -200 /tmp/fr/prep03.280111 | grep 'Year' > $TMP
if [ -s $TMP ]; then
mailx -s "Error from log" fxxx@yyy.com < $TMP
fi
rm -f $TMP # cleanup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2011 05:30 AM
10-14-2011 05:30 AM
Re: mailx: deleted 251 NULL characters in mail file ERROR
In the end I used a tail, so it gave the result that I wanted, but..
thanks a lot for your help
FR