diff --git a/alias.txt b/alias.txt index ed04414..a209276 100644 --- a/alias.txt +++ b/alias.txt @@ -257,10 +257,8 @@ function 7zx() { local direct_pattern='\.(zip|7z|rar)$' if [[ "$lower_name" =~ $tar_pattern ]]; then - # 先解压外层(xz/gz/bz2/zst),再解tar 7z x -so "$archive" | 7z x -si -ttar -o"$outdir" elif [[ "$lower_name" =~ $direct_pattern ]]; then - # 直接解压 7z x "$archive" -o"$outdir" else echo "⚠️ 不支持的格式: $archive" >&2 @@ -272,7 +270,6 @@ function 7zxd() { local password="$1" local files=() - # 搜索所有压缩包(支持分卷 .part1.rar/.001) while IFS= read -r -d '' f; do files+=("$f") done < <(find . -maxdepth 1 -type f \( \ @@ -300,7 +297,6 @@ function 7zxd() { if [[ $? -eq 0 ]]; then echo "✅ 解压成功,删除源文件..." - # 删除所有相关分卷,如 .part1.rar .part2.rar 等或 .001/.002 local prefix="${file%%.*}" find . -maxdepth 1 -type f -regex "./$prefix\\..*" -delete else