有没有办法比较位于同一文件夹中的最新02文件?
答案 0 :(得分:1)
#!/bin/bash
diff_latest(){
local file latest second
for file in "${1:-.}"/*; do
[[ $file -nt $latest ]] && second="$latest" && latest="$file"
done
diff "$latest" "$second"
}
diff_latest /path/to/some/dir
答案 1 :(得分:0)