B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-25 Wednesday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  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
Regist Addr [ 211.111.244.57 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.02 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®