Merge pull request #1087 from sofia-riese/patch-2

Corrects potential errors when filenames are separated by spaces
This commit is contained in:
juewuy
2026-01-07 17:52:43 +08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
#检查目录剩余空间——$1:目标路径 $2:-h参数
dir_avail() {
df -h >/dev/null 2>&1 && h="$2"
df -P $h "${1:-.}" 2>/dev/null | awk 'NR==2 {print $(NF-2)}'
}
df -P $h "${1:-.}" 2>/dev/null | awk 'NR==2 {print $4}'
}