diff --git a/d2t.sh b/d2t.sh new file mode 100644 index 0000000..f734da8 --- /dev/null +++ b/d2t.sh @@ -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