- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- changing contents of a file that can only be viewe...
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
07-24-2003 07:46 AM
07-24-2003 07:46 AM
changing contents of a file that can only be viewed using strings???
I can view it using strings, however I need to change a line of the text.
Can I use strings to redirect the contents to a simple text file and then is there a way to redirect that changed file to the format of the original file that I can view with "strings"???
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 07:51 AM
07-24-2003 07:51 AM
Re: changing contents of a file that can only be viewed using strings???
you can try, but at your own risk, to change the string using sed
cat yourfile | sed s/textin/textout/ > yournewfile.
Take a backup of that file, before.
Otherwise, if is is not very big, get an exadecimal editor, like ultraedit32 on windows, change whatever you want and then take the file back up hpux.
remember to transfer the file using binary mode.
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 07:52 AM
07-24-2003 07:52 AM
Re: changing contents of a file that can only be viewed using strings???
http://hpux.connect.org.uk/hppd/hpux/Development/Tools/hexedit-0.9.7/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 07:52 AM
07-24-2003 07:52 AM
Re: changing contents of a file that can only be viewed using strings???
I guess I'd try that on a test copy of the file before I touched the real one. Sounds risky to me.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 07:52 AM
07-24-2003 07:52 AM
Re: changing contents of a file that can only be viewed using strings???
No, you cannot rely on the output of 'strings'.
You would need to know the exact data layout; read the binary file with a C-program; modify the data so read; and write it again.
'strings' simply reports what is can by finding four or more ASCII printing characters. You will *not* necessarily see all data!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 07:58 AM
07-24-2003 07:58 AM
Re: changing contents of a file that can only be viewed using strings???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 07:58 AM
07-24-2003 07:58 AM
Re: changing contents of a file that can only be viewed using strings???
1. strings file1 > file2.txt
2. vi file2.txt (make my simple change in this text file)
I still need to know how to change the file from file2.txt to the original format.
I am attaching the original file to see what I am talking about (named shell.so), I need to change the path shown from /oradata to /oradata2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 08:04 AM
07-24-2003 08:04 AM
Re: changing contents of a file that can only be viewed using strings???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 08:11 AM
07-24-2003 08:11 AM
Re: changing contents of a file that can only be viewed using strings???
Running strings is a one-way process. Once you've done a strings yourbinaryfile >file2.txt then you've lost ALL the data EXCEPT for the stuff that strings believes is readable text (ie words of 4 chars or more.)
So - anything you then do with file2.txt after you edit it will not be able to be put back into a working state due to the missing stuff.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 08:15 AM
07-24-2003 08:15 AM
Re: changing contents of a file that can only be viewed using strings???
if you tried it and didn't work, the follow Clay's hint and get an hexadecimal editor, either on windows or on hpux, whichever is simpler for you.
Since file is short, i will use uedit32, i always have it on my pc, this is why i suggested it to you :)
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 08:17 AM
07-24-2003 08:17 AM
Re: changing contents of a file that can only be viewed using strings???
regards,
Darren.