- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: HPUX commands?
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
02-26-2001 10:05 PM
02-26-2001 10:05 PM
HPUX commands?
What are the commands that can be used if I wanna to find certain words and then need to replace that words with the new words.
Example, testing1.txt. Inside the testing1.txt has many of "$HOSTNAME" I wanna to replace the "$HOSTNAME" to "$BAAN" for example.
I should used the command like find ./-name..?
Maybe I need the HPUX command for replace the word?
Thank you in advance for whom help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2001 10:17 PM
02-26-2001 10:17 PM
Re: HPUX commands?
To change text in a file, you should use 'sed'.
cat yourfile | sed -e 's/\$HOSTNAME/\$BAAN/g' > yourfile.new
should do the job. The 's' in the sed command means 'substitute' and the trailing 'g' means 'globally' (ie every occurence on a line).
The stuff between the slashes is what and to what you want to change.
See the sed(1) manpage for more info on sed and the regexp(5) manpage for info on regular expressions.
Hope this helps,
Rik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2001 06:55 AM
02-27-2001 06:55 AM
Re: HPUX commands?
cat yourfile | sed 's, \$HOSTNAME, i\ \$BAAN,g' > yourfile.new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2001 01:56 PM
02-28-2001 01:56 PM
Re: HPUX commands?
why not using "ed"?
find . -exec ed -e '1,$s/\$HOSTNAME/\$BAAN/g' -e'1,$w' {} ";"
that should do the trick...
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2001 02:07 PM
02-28-2001 02:07 PM
Re: HPUX commands?
cat file | sed -e s/pattern1/pattern2/g > newfile