how to change some text of a certain line of a text file with bash and *nix scripting
how to change some text of a certain line of a text file with bash and *nix scripting ??
i could have use pascal to do that but ... how to do it with bash , awk , sed or whatever the *nix guys like to do ?? eg :: theres a file with the content of :: Code:
... the above file will be updated to :: Code:
... //thanks in advance ... . |
Code:
sed s/192.168.1.15/192.168.1.1/ inputfile >outputfile Code:
mv inputfile inputfile.DATESTAMP |
let me catch some breath first ...
... ok ... great and fast , thanks ... i believe your code works but what if i want to "search" for the occurance of private final String thisAddr= and change the remaining text until the end of line ... probably i should give a "dobuild "192.168.1.1"" or something ?? what should i do ?? . |
Try as your "dobuild" script ...
Code:
#!/bin/bash |
thank to both of you and the hints on doing things more carefully ... they work great ...
. |
Quote:
Code:
sed 's/\(private final String thisAddr=\).*/\1'$1'/' |
this one also works great ...
strange erhh ... ^_^ . |
All times are GMT -5. The time now is 01:04 PM. |