分类: LINUX
2008-08-11 21:23:51
awk 'ok ==0 && /1234/{ sub(/1234/,"abc");print; ok = 1; next; } (ok == 1){print}' tmp.txt |
|
ok=0; while read -r l; do if [[ "$l" =~ "1234" && $ok == 0 ]] ;then l="${l/1234/abc}";ok=1; fi; echo "$l"; done |
let g:first = 0 function! Tmp(src, dest) if g:first == 0 let g:first=1 return a:dest endif return a:src endfunction |