Advertisement
Guest User

1.awk

a guest
Apr 9th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.22 KB | None | 0 0
  1. awk -v ip="192.168.0.10" -v usuario="carlos" '{
  2.     Registro[NR]=$0
  3.     IPS[NR]=$3
  4.     USUARIOS[NR]=$8
  5. } END {
  6.     for (i=1; i<=NR; i++) {
  7.         if (IPS[i]==ip) sub(USUARIOS[i],usuario,Registro[i])
  8.         print Registro[i]
  9.     }
  10. }' 1.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement