Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- arqA=/tmp/arquivoA
- arqB=/tmp/arquivoB
- clear
- while read linha
- do
- coords=( $(sed 's/,/ /g' <<< $linha) )
- sed -r -i ":a;/}/!{N;ba}; /${coords[0]}/s/(.*2d_coords )(.*)(\n.*)/\1${coords[1]},${coords[2]}\3/g" ${arqB}
- done < ${arqA}
- #Resultando na saída
- #define hostextinfo{
- #host_name server1
- #2d_coords 133,809
- #}
- #
- #define hostextinfo{
- #host_name server_ad01
- #2d_coords 297,1108
- #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement