I have an array of JSON object with inside local urls and speed parameters like [{server:192.168.0.100, speed:34}, {server:192.168.0.130, speed:52},...]I need to update the speed value for each server..Reading links like  Replace only if the string is found in a certain context  I've tried this:#first by first I delete the old valuesed -i 's/speed:\(.\), //g' $FILENAMEsed -i 's/speed:\(..\), //g' $FILENAMEsed -i 's/speed:\(...\), //g' $FILENAMEsed -i 's/speed:\(....\), //g' $FILENAME#then I've tried to calculate the new onesed -i s/server:\\(192.168.0...\)\/server:\\1\, speed:$( ping -c3 \\1 | grep rtt | cut -f 5 -d '/' ), /g $FILENAMEBut it doesn't work:unknown host \1
Replace a value in a file, in a certain context, with an operation result
text processing;sed;json