- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Anyone for scripting?
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
тАО03-26-2003 02:45 AM
тАО03-26-2003 02:45 AM
Anyone for scripting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2003 03:17 AM
тАО03-26-2003 03:17 AM
Re: Anyone for scripting?
Using sed:
% echo abcdefghijkl | sed 's/\(^....\)...\(.*\)/\1zzz\2/'
abcdzzzhijkl
%
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2003 03:18 AM
тАО03-26-2003 03:18 AM
Re: Anyone for scripting?
for i in `cat file`
do
VAR=`echo $i | cut -c 5-7`
echo $i | sed 's/'$VAR'/
done
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2003 03:20 AM
тАО03-26-2003 03:20 AM
Re: Anyone for scripting?
sed 's;^\(....\)...;\1ABC;' file
should replace 5th, 6th and 7th chars to ABC.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2003 03:22 AM
тАО03-26-2003 03:22 AM
Re: Anyone for scripting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2003 03:27 AM
тАО03-26-2003 03:27 AM
Re: Anyone for scripting?
nawk '{ print substr($0, 1, 4) "XXX" substr($0, 8) }' filename
Where XXX are your alternate characters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2003 03:30 AM
тАО03-26-2003 03:30 AM
Re: Anyone for scripting?
awk '{
printf "%s%s%s\n", substr($0,1,4),
"ABC",
substr($0, 8)}'
}' file
will do the same ...
Regards.