zsh gem(1)

zsh is my favorate shell, super powerful. there are a lot of blogs about it, and I recommend
a book From bash to z shell, and the site also contains some wonderful references.

Here I just wanna show some cool quick snippets of what zsh capable of, just for fun.
So guess what this does?

compare_dirs.shview raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/zsh

if [ $# -lt 2 ]; then
echo "need src dest dir to compare"
exit 1
fi

pushd $1
print -l *(e:'[[ ! -e $2/$REPLY ]]':) 2>/dev/null
popd


#pushd $2
#print -l *(e:'[[ ! -e $1/$REPLY ]]':) 2>/dev/null
#popd