for x in 1 2 3 4 5 ;do for y in 5 4 3 2 1 ;do 일 경우 결과는 x=1,y=5 x=1,y=4 x=1,y=3 x=1,y=2 x=1,y=1 x=2,y=5 x=2,y=4 x=2,y=3 x=2,y=2 x=2,y=1 ... 이렇게 총 25개의 결과가 나오는데
저는 x=1,y=5 x=2,y=4 x=3,y=3 x=4,y=2 x=5,y=1 이렇게 5개의 결과가 나오기를 바랍니다..
$ cat x 1 2 3 4 5 $ cat y 5 4 3 2 1 $ paste x y | while read -r x y; do echo "x=$x, y=$y"; done x=1, y=5 x=2, y=4 x=3, y=3 x=4, y=2 x=5, y=1
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
$ x=(1 2 3 4 5) $ y=(5 4 3 2 1) $ for ((i = 0; i < ${#x[@]}; i++)); do echo "x=${x[$i]}, y=${y[$i]}"; done x=1, y=5 x=2, y=4 x=3, y=3 x=4, y=2 x=5, y=1
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
음 ..
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
음 ..
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
댓글 달기