请教zsh的两个命令

sh/bash/dash/ksh/zsh等Shell脚本
回复
skylyj
帖子: 52
注册时间: 2009-08-22 17:57

请教zsh的两个命令

#1

帖子 skylyj » 2010-07-19 18:32

# Replace spaces (any number of them) with a single dash in file names
$ autload zmv
$ zmv -n '(**/)(* *)' '$1${2//( #-## #| ##)/-}'
这个表达式是什么意思( #-## #| ##)
# Add *.py to a bunch of python scripts in a directory (some of them end
# in *.py and give them all a proper extension
$ autoload zmv
$ zmv -n '(**/)(con*)(#qe,file $REPLY | grep "python script",)' '$1$2.py'
其中的con*和#q是什么意思
回复