I want to change a line in a bunch of similar scripts using sed. Some of these scripts do not actually contain the line I want to change. However, sed doesn't tell me it didn't change the line cause it wasn't there. Any ideas on how I can make sed spit out a warning? Say, I have script one
log export ALBET=0.155
log export ALBEG=0.218
log export RADGHGCOEF=1.0
and script two
log export ALBET=0.168
log export ALBEG=0.201
then
sed -i 's/RADGHGCOEF=.*/RADGHGCOEF=2.0/' script
works on both on them, but I'd like to be informed that there was actually no line containing RADGHGCOEF to be changed in script 2. Thanks!