- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Redirect text file content from tar archive to std...
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
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
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-09-2012 08:27 AM
10-09-2012 08:27 AM
Redirect text file content from tar archive to stdout (without extract it)
Hi,
I have a TAR archive that contains several text files. I would like to write a script to display (stdout) the content of a file without extracting it in the current directory.
Actually I would like to do the same as:
tar tf myArchive.tar folder/someFile.txt cat folder/someFile.txt rm -R folder
but without the rm...
I tried this way but it didn't work:
tar -xOf myArchive.tar folder/someFile.txt
Thanks
- Tags:
- gtar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2012 09:18 AM
10-09-2012 09:18 AM
Re: Redirect text file content from tar archive to stdout (without extract it)
-O only works with gtar:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2012 09:27 AM
10-09-2012 09:27 AM
Re: Redirect text file content from tar archive to stdout (without extract it)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2012 09:34 AM
10-09-2012 09:34 AM
Re: Redirect text file content from tar archive to stdout (without extract it)
I am not aware of a way to make the HP-UX native 'tar' do this. I do not think it is possible.
If you really need to do this, you can get 'gtar' from the link supplied by Dennis above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2012 09:46 AM
10-09-2012 09:46 AM
Re: Redirect text file content from tar archive to stdout (without extract it)
>I do not have gtar, so what should I do to have the same behaviour?
You get the same software, gtar.
Or write a script to extract to a temp file using pax, cat, then remove.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2012 05:59 AM
10-10-2012 05:59 AM
Re: Redirect text file content from tar archive to stdout (without extract it)
@Dennis Handly: right, this is what I am going to do. Thanks