Create d2t.sh

This commit is contained in:
tianyu 2014-12-21 17:31:00 +08:00
parent 3ae3af67c4
commit 9954d86b6e
1 changed files with 14 additions and 0 deletions

14
d2t.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
#==============================================================================
check_sub(){
SAVEIFS=$IFS # setup this case the space char in file name.
IFS=$(echo -en "\n\b")
for subdir in $(find -maxdepth 1 -type d |grep ./ |cut -c 3-);
do
echo $subdir
tar cf "$subdir.tar" "$subdir"
done
IFS=$SAVEIFS
}
check_sub