for문을 써서 로그인 기록을 보는 last의 접속 시간들만 골라서 모두 더하려고 합니다.
접속 시간을 고르려면 한 줄씩 출력해야 하는데
for문에서 선언한 변수인 i번째 줄만 출력하도록 sed 쓰는 방법 좀 부탁드립니다...
https://kldp.org/node/137966
파일을 라인 단위로 읽어들일 때에는.. 그냥 간단히 while loop 에서 read 쓰시면 됩니다. 명령줄에서 실행한 것들을 읽어 들일 때에도 그냥 pipe 로 연결하면 되죠..
while read line do do_something done < filename last | while read line do do_something done
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
텍스트 포맷에 대한 자세한 정보
<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]
음 ..
https://kldp.org/node/137966
파일을 라인 단위로 읽어들일 때에는.. 그냥 간단히 while loop 에서 read 쓰시면 됩니다.
명령줄에서 실행한 것들을 읽어 들일 때에도 그냥 pipe 로 연결하면 되죠..
되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』
댓글 달기