- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to send shell .sh history file in email in rig...
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
Discussions
Discussions
Discussions
Forums
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
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
тАО05-17-2010 07:43 AM
тАО05-17-2010 07:43 AM
How to send shell .sh history file in email in right format ?
How to fix it.? thx
===========================================
# translating some non-ascii char to space ##that was causing email problems ##
#!/bin/ksh
file=".sh__root_tibco_3111_09:28:08"
cat ${file} | tr "\201" "\040" >> emailbody
cat emailbody | mailx -s "`uname -n` on `date`" $MAILADMIN
===========================================
.sh__test_tibco_3111_09:28:08
=============================
ps -ef|grep hawk
kill -9 23008 22924
ps -ef|grep hawk
cd /app/tibco
cd log
ls -la
tail -f strtadmin.log
ls -la
tail -f notification.log
crontab -l
/usr/ucb/ps -auxww|grep NotificationDBAgent|grep -v grep kill -9 18298 /usr/ucb/ps -auxww|grep NotificationDBAgent|grep -v grep ls -la cd /app/tibco ls -lka ls -la cd adapter ls -la тАЪ cd adadb ls -la cd 5.2 ls -la cd odbc ls -la ls -la cp odbc.ini odbc.ini20100517 cat odbc.ini more odbc.ini ls -la crontab -l cd /app/tibco/bin/strstp ls -la cat recycle.sh crontab -l recycle.sh daily_stop crontab -l ls -la cat recycle.sh ls -la cat strstpAdbAgent.sh ls -la cat strstpTibco.sh crontab -l ps -ef|grep acco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2010 08:34 AM
тАО05-17-2010 08:34 AM
Re: How to send shell .sh history file in email in right format ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2010 09:38 AM
тАО05-17-2010 09:38 AM
Re: How to send shell .sh history file in email in right format ?
Do what you need to parse your output to a single file.
Then: http://hpux.ws/mailfile2
It is a good file attachment sender. Well tested.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2010 12:43 AM
тАО05-18-2010 12:43 AM
Re: How to send shell .sh history file in email in right format ?
You can see them with: vis $HISTFILE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2010 03:58 AM
тАО05-18-2010 03:58 AM
Re: How to send shell .sh history file in email in right format ?
unix2dos did not work but I am testing more.
thks for attachment for email but I am wondering if someone is email themselves shell history and if it looks ok in email.
Thanks for all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2010 04:26 AM
тАО05-18-2010 04:26 AM
Re: How to send shell .sh history file in email in right format ?
strings .sh_history | vis | mailx -s "`uname -n` on `date`" $MAILADMIN
Your filter program is fixing only one of dozens of possibilities for binary characters. The strings command will extract what appears to be ASCII strings (but they could contain special characters) and vis will expose them using \000 where 000 is the octal code for the special character.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2010 04:46 AM
тАО05-18-2010 04:46 AM
Re: How to send shell .sh history file in email in right format ?
As Dennis and Bill have noted, the history file contains binary data. In particular, NUL characters delimit the commands. I can recreate your problem and can fix it (if you don't mind double-spaced output) thusly:
# perl -pe 's{^\000+}{\012}' /root/.sh_history|mailx -s "Your History File" you@your.net
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2010 06:58 AM
тАО05-18-2010 06:58 AM
Re: How to send shell .sh history file in email in right format ?
You have a simple way to achieve this.
Connect to the unix machine to winscp. Copy the .sh_history_file. Check it with wordpad and if ok and need to send it to someone help, hust do it ..
Regards.