HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Recursive file updates
Operating System - HP-UX
1834202
Members
3486
Online
110066
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
03-06-2008 11:42 AM
03-06-2008 11:42 AM
Recursive file updates
Env.: HP-UX B.11.23 - 64 bit
I would like to update a path name in many files in the dir and sub-dir.
For eg. path name like /tech/oracle has to be changed to /appl/oracle in more than 100 files.
Please provide me the syntax.
Thanks & Regards
Balaji
I would like to update a path name in many files in the dir and sub-dir.
For eg. path name like /tech/oracle has to be changed to /appl/oracle in more than 100 files.
Please provide me the syntax.
Thanks & Regards
Balaji
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 01:46 PM
03-06-2008 01:46 PM
Re: Recursive file updates
Hi:
You can craft a simple shell script to 'find()' files and having found a file, use 'sed' to substitute your strings.
We could perform the whole process much more efficiently in Perl, too.
Regards!
...JRF...
You can craft a simple shell script to 'find()' files and having found a file, use 'sed' to substitute your strings.
We could perform the whole process much more efficiently in Perl, too.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 06:39 PM
03-06-2008 06:39 PM
Re: Recursive file updates
I have creatad a script to make changes to an unlimited number of files using simple old_string and new_string syntax (attached). By default, it simply highlights what the old and new lines will look like. It will work on one or more files and will also accept stdin.
Usage: chgafile [ -w ] [ -q ] [ -s ] old-text new-text [ filename(s) ]
-w to write changes (default = preview only)
-q quiet mode (no before/after lines)
-s silent (no output at all except for file or STDOUT) -s also turns on -q for no output at all
old-text and new-text are the strings
one or more files to change or no filenames for STDIN
Bill Hassell, sysadmin
Usage: chgafile [ -w ] [ -q ] [ -s ] old-text new-text [ filename(s) ]
-w to write changes (default = preview only)
-q quiet mode (no before/after lines)
-s silent (no output at all except for file or STDOUT) -s also turns on -q for no output at all
old-text and new-text are the strings
one or more files to change or no filenames for STDIN
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP