¿À´ÃÀº °î¿ìÀÔ´Ï´Ù.sun's longitude:29 29 20 
¡¤ ÀÚÀ¯°Ô½ÃÆÇ ¡¤ ¹¯°í´äÇϱ⠡¤ ¾ËÆĹ®¼­ ¡¤ RPMS list
¡¤ »ç¿ëÀÚ¹®¼­ ¡¤ ÆÁ/FAQ¸ðÀ½ ¡¤ ¸®´ª½ºLinks ¡¤ ÀÚ·á½Ç
¡¤ ¼­¹öÁ¤º¸ ¡¤ ¿î¿µÀÚ ¡¤ Books/FAQ ¡¤ FreeBSD
 
/board/read.php:¼Ò½ºº¸±â   
 
¾ËÆĹ®¼­
ÀÚÁÖ Àؾî¸Ô°Å³ª, ¸Þ¸ðÇØ µÑ Çʿ伺ÀÌ ÀÖ´Â ÆÁÀ̳ª ¹®¼­, ±âŸ µîµî
[*** ¾²±â ±ÝÁö´Ü¾î ÆÐÅÏ ***]
±Û º»¹® Áß°£¿¡ ¾÷·ÎµåÇÒ À̹ÌÁö¸¦ Ãß°¡ÇÏ´Â ¹æ¹ý : @@À̹ÌÁöÀ̸§@@
ex) @@foo.gif@@
108 ¹ø ±Û: [SHELL] ¶óÀδÜÀ§·Î Àоî¿À±â
±Û¾´ÀÌ: »êÀÌ [ȨÆäÀÌÁö] ±Û¾´³¯: 2005³â 01¿ù 02ÀÏ 05:57:22 ÀÏ(»õº®) Á¶È¸: 3461
-- example.sh -----------------------------
#!/bin/sh

OIFS=$IFS

TT="10
  21 22 23 2444444444444444
30 31

50


  61
70
"

echo '------------------------------------'
echo 'orignal string'
echo "$TT"
echo '------------------------------------'

echo '------------------------------------'
echo 'for() test with default IFS'
echo '------------------------------------'

for n in $TT ; do
  echo "'$n'"
done

IFS='
'
echo '------------------------------------'
echo 'for() test with \r\n IFS'
echo '------------------------------------'

for n in $TT ; do
  echo "'$n'"
done

IFS=$OIFS
echo '------------------------------------'
echo 'pipe and read test with default IFS'
echo '------------------------------------'

echo "$TT" | while read line etc ; do
  echo "'$line' '$etc'"
done

IFS='
'
echo '------------------------------------'
echo 'pipe and read test with \r\n IFS'
echo '------------------------------------'

echo "$TT" | while read line etc ; do
  echo "'$line' '$etc'"
done

IFS=$OIFS
echo '------------------------------------'
echo 'stdin read file with default IFS'
echo '------------------------------------'

while read line etc ; do
  echo "'$line' '$etc'"
done < /tmp/foo.txt

IFS='
'
echo '------------------------------------'
echo 'stdin read file with \r\n IFS'
echo '------------------------------------'

while read line etc ; do
  echo "'$line' '$etc'"
done < /tmp/foo.txt

IFS=$OIFS
echo '------------------------------------'
echo 'single line read with default IFS'
echo '------------------------------------'

echo "some foo bar comment" |
{
  read first second others
  echo "'${first}' '${second}' '${others}'"
}

IFS='
'
echo '------------------------------------'
echo 'single line read with default IFS'
echo '------------------------------------'

echo "some foo bar comment" |
{
  read first second others
  echo "'${first}' '${second}' '${others}'"
}

echo
echo "external variable test: '${first}'" ## is empty

exit 0
---------------------------------------------------

// result

------------------------------------
orignal string
------------------------------------
10
  21 22 23 2444444444444444
30 31

50


  61
70

------------------------------------
for() test with default IFS
------------------------------------
'10'
'21'
'22'
'23'
'2444444444444444'
'30'
'31'
'50'
'61'
'70'
------------------------------------
for() test with \r\n IFS
------------------------------------
'10'
'  21 22 23 2444444444444444'
'30 31'
'50'
'  61'
'70'
------------------------------------
pipe and read test with default IFS
------------------------------------
'10' ''
'21' '22 23 2444444444444444'
'30' '31'
'' ''
'50' ''
'' ''
'' ''
'61' ''
'70' ''
'' ''
------------------------------------
pipe and read test with \r\n IFS
------------------------------------
'10' ''
'  21 22 23 2444444444444444' ''
'30 31' ''
'' ''
'50' ''
'' ''
'' ''
'  61' ''
'70' ''
'' ''
------------------------------------
stdin read file with default IFS
------------------------------------
'111' '22222'
'file' ''
'foo' ''
------------------------------------
stdin read file with \r\n IFS
------------------------------------
'111 22222' ''
'  file' ''
'foo' ''
------------------------------------
single line read with default IFS
------------------------------------
'some' 'foo' 'bar comment'
------------------------------------
single line read with default IFS
------------------------------------
'some foo bar comment' '' ''

external variable test: ''

 
ÀÌÀü±Û : [MySQL] mysql memory setting table
´ÙÀ½±Û : [PHP & SHELL] daemon mode -- background  
 from 61.254.75.78
JS(Redhands)Board 0.4 +@

|±Û¾²±â| |´äÀå¾²±â| |¼öÁ¤| |»èÁ¦|
|ÀÌÀü±Û| |´ÙÀ½±Û| |¸ñ·Ïº¸±â|
Àμâ¿ë 

apache lighttpd linuxchannel.net 
Copyright 1997-2024. linuxchannel.net. All rights reserved.

Page loading: 0.06(server) + (network) + (browser) seconds