Results 1 to 3 of 3
Hello,
I've a bash shell script, which generates a file with the following content:
compute-0-0
compute-0-0
compute-0-1
compute-0-0
compute-0-0
compute-0-0
...
I need to modify this file with the same ...
- 11-18-2008 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 13
How to: Replace "compute-0-" with "ibc" in a file
Hello,
I've a bash shell script, which generates a file with the following content:
compute-0-0
compute-0-0
compute-0-1
compute-0-0
compute-0-0
compute-0-0
...
I need to modify this file with the same script such that it should replace the first 10 characters, i.e. "compute-0-" with "ibc".
How to do this?
With what all commands can this be achieved?
Thanks,
Sangamesh
- 11-18-2008 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
Code:sed -i 's/^compute-0-/ibc/' file
- 11-19-2008 #3Just Joined!
- Join Date
- Oct 2007
- Posts
- 13
Thanks. Its working


Reply With Quote