These get some of the semantics wrong. I would at very least change the last function...
sw() {
tmp=$(mktemp)
mv "$1" "$tmp" && \
mv "$2" "$1" && \
mv "$tmp" "$2"
}
No problem.
At first glance, all of the arguments you pass to the commands are missing, also lists of files.
I've actually thought about re-writing these in `c` just to get rid of the `python` dependency, but it seems like overkill for something not a lot of people use.
Well, the arguments might seem missing, but then again the commands seem to work. Yes, the Python dependency seems overkill, but then again, also rewriting. A posix shell version seems most appropriate, because no dependencies at all and easy installation.