Computing.Net > Forums > Unix > Shell script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell script

Reply to Message Icon

Name: Terry
Date: January 1, 2003 at 21:07:25 Pacific
OS: unix
CPU/Ram: -
Comment:

Hi all,
How can I develop shell script to replace
line. for example
==========================
xxxxxxxxx yyyyyyyy zzzzzzzzz
dd fffffff gffff dddddd
zzz ddf rr44w fertt
dd fffffff erjkew dlkf
==========================
I want to : replace the line that begin woth
dd fffffff
to
dd fffffff 123456

that make the result
==========================
xxxxxxxxx yyyyyyyy zzzzzzzzz
dd fffffff 123456
zzz ddf rr44w fertt
dd fffffff 123456
==========================

Terry



Sponsored Link
Ads by Google

Response Number 1
Name: Jimbo
Date: January 1, 2003 at 22:03:41 Pacific
Reply:

sed 's/^\(dd f\{7\}\) .*$/\1 123456/' YOUR_FILE

There is a space between the last ")" and the "."

-jim


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Shell script

Shell Scripting www.computing.net/answers/unix/shell-scripting/8475.html

Variables in Shell SCripting www.computing.net/answers/unix/variables-in-shell-scripting/6020.html

shell script to uninstall java www.computing.net/answers/unix/shell-script-to-uninstall-java-/5976.html