2007年8月25日土曜日

while

$ ls
tar_test.tar     test.tar.gz  test10  test3  test5  test7  test9
tar_test.tar.gz  test1        test2   test4  test6  test8
$ ls -1 | while read LINE; do file "$LINE"; done
tar_test.tar: POSIX tar archive
tar_test.tar.gz: gzip compressed data, from Unix
test.tar.gz: POSIX tar archive
test1: ASCII text
test10: ASCII text
test2: ASCII text
test3: ASCII text
test4: ASCII text
test5: ASCII text
test6: ASCII text
test7: ASCII text
test8: ASCII text
test9: ASCII text

0 件のコメント: