- #!/bin/bash
- direc=$(pwd)
- targetpath=/usr/tmp
- OLDIFS=$IFS
- IFS=:
- for path in $( find $direc -type d -printf "%p$IFS")
- do
- mkdir -p "$targetpath/${path:${#direc}+1}"
- unzip -x "$path/*.zip" -d "$targetpath/${path:${#direc}+1}"
- done
- IFS=$OLDIFS
- #该片段来自于http://www.codesnippet.cn/detail/250420133035.html
来源: http://www.codesnippet.cn/detail/250420133035.html