반응형 RETRY/shellScript-ex1 TAR 폴더 별 압축 하기 하기 내용은 핀란드 헤이키님의 글 을 재구성이라기 보다는 Ctrl+C, Ctrl+V 한 내용입니다. Linux 특정 폴더 상에 폴더 별 압축을 진행하는 shell script 입니다. # vi tar_folder.sh #!/bin/sh DIRS=`ls -l $PWD | egrep '^d' | awk '{print $9}'` # "ls -l $MYDIR" = get a directory listing# "| egrep '^d'" = pipe to egrep and select only the directories# "awk '{print $9}'" = pipe the result from egrep to awk and print only the 9th field for DIR in $DIRSdo echo .. 2017. 1. 8. 이전 1 다음 반응형