update-links (346B)
1 #!/bin/zsh 2 setopt extended_glob no_unset 3 cd $0:h || exit $? 4 if [[ -e by-sha256 ]]; then 5 rm -r by-sha256 || exit $? 6 fi 7 mkdir -p by-sha256 || exit $? 8 cd by-sha256 || exit $? 9 for f in ../*(.); do 10 h=${"$(sha256sum $f)"%% *} || exit $? 11 ln -sTf $f $h || exit $? 12 done 13 for f in ../../downloads/sha256/*(.); do 14 h=${f:t} 15 ln -sTf $f $h || exit $? 16 done