Code:
s/ MGW_NAME 401/ MGW_NAME MNS01/g;
s/ MGW_NAME 402/ MGW_NAME MNS02/g;
s/ MGW_NAME 403/ MGW_NAME MNS03/g;
s/ MGW_NAME 404/ MGW_NAME MNS04/g"
this can be simplified to a variant of 's/( MGW_NAME )4(0[1-4])/\1MNS\2/g'
Code:
while read -r -d$'\0' file
do
ed -s "$file" <<< 'g/PAPU_INDEX 36/-42,+144d
,s/\( MGW_NAME \)4\(0[1-4]\)/\1MNS\2/g
w'
done < <( find /appl/virtuo/gways/spool/nokia/MGW/U4.1/temp/ -iname '*P_SGSN_SESSION_MANAGEMENT*' -type f -print0 )
is there a reason to run the script with sh and not bash? Bash in general is more feature rich.
PS. damn it, there is next to no ed know-how on the internet, pretty much only dry man pages -_-
Bookmarks