- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Appending two file parllaly
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
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
тАО08-17-2010 08:17 PM
тАО08-17-2010 08:17 PM
Appending two file parllaly
I have defined HISTFILE=/home/.sh_history
here all commands which i type will be appended to /home/.sh_history
I have created file /var/goodfile.Here my requirement is /var/goodfile also should also get appended with commands which i have typed parallely with /home/.sh_history
Chandra
- Tags:
- history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2010 09:10 PM
тАО08-17-2010 09:10 PM
Re: Appending two file parllaly
history -100 >> /var/goodfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2010 09:21 PM
тАО08-17-2010 09:21 PM
Re: Appending two file parllaly
Dennis if i do so there is possibility where same content appending multiple times to second file.
Chandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2010 09:51 PM
тАО08-17-2010 09:51 PM
Re: Appending two file parllaly
Yes. If you don't want overlapping commands you will have to work harder:
history -100 >> /var/goodfile
last_history=$(history -0 | awk '{print $1}')
your commands ...
history $last_history >> /var/goodfile
last_history=$(history -0 | awk '{print $1}')
Then repeat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2010 10:05 PM
тАО08-17-2010 10:05 PM
Re: Appending two file parllaly
Or you simply don't care and then you fix the output later:
sort -u /var/goodfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2010 03:15 AM
тАО08-19-2010 03:15 AM
Re: Appending two file parllaly
# tail -f /home/.sh_history >> /var/goodfile
rgs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2010 03:37 PM
тАО08-19-2010 03:37 PM
Re: Appending two file parllaly
Be aware that your shell history has binary data in it. Where the history command knows the format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2010 12:55 AM
тАО08-20-2010 12:55 AM
Re: Appending two file parllaly
That's right. What if you would copy it real-time with a background dd? This dd won't terminate until it reaches an EOF. Maybe you could try it, I don't know if it works...
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2010 07:36 AM
тАО08-20-2010 07:36 AM
Re: Appending two file parllaly
Why would you use dd(1) when tail "works"?
(tail doesn't care about binary and doesn't stop at the EOF.)