更新 alias.txt

This commit is contained in:
2025-10-12 13:13:56 +02:00
parent ad9c52f7bc
commit 58d6cff6c5

View File

@@ -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