|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 199 article |
2005-08-03 09:57:55 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
ÆÄÀÏÀÇ ÁÙ´ÜÀ§ ÆíÁý (edÀÇ È°¿ë) |
|
|
# 40 ¹ø° ¶óÀο¡ ÁÙ»ðÀÔ
ed - -s filename << end
40i
À̱ÛÀº»ðÀԵɳ»¿ë
ÀÌÁÙµµ»ðÀԵɳ»¿ë(.(Á¡)ÀÌÁ¾°á¹®ÀÚ)
.
w
end
# 40 ~ 60¹ø° ¶óÀÎ ÁÙ»èÁ¦
ed - -s filename << end
40,60d
w
end
# 40 ~ 60¹ø° ¶óÀÎÀÇ ³»¿ëº¯°æ
ed - -s filename << end
40,60s/º¯°æÀü/º¯°æÈÄ/g
w
end
######## ½ºÅ©¸³Æ®¿¡¼ È°¿ë
# ƯÁ¤ ¹®ÀÚ¿ÀÌ ´ã±ä ÁÙ¹øÈ£ º¯¼ö·Î ´ã¾Æ ÇØ´ç¿ »èÁ¦
deleteline=$(cat -n filename | grep "¹®ÀÚ¿" | awk '{print $1}' | head -n1)
ed - -s filename << end
${deleteline}d
w
end
# ƯÁ¤ ¹®ÀÚ¿ ´ÙÀ½ÁÙ ºÎÅÍ Æ¯Á¤ ³»¿ë »ðÀÔ
insertline=$(cat -n filename | grep "¹®ÀÚ¿" | awk '{print $1}' | head -n1)
ed - -s filename << end
$(( $insertline + 1 ))i
»ðÀÔ³»¿ë
»ðÀÔ³»¿ë2
.
w
end
|
|
Page Loading [ 0.02 Sec ]
SQL Time [ 0 Sec ]
|
|
|