我偶然發現了一個 Z shell ( zsh
) 完成檔案,但我不知道-nt
操作員做了什么。
if ! [ -r $cache -a -s $cache ] || [ "$squeezy" -nt $cache ]
解釋是什么?這甚至是一個有效的運算子,還是作者的錯字?
這是整個檔案:
#compdef squeezy
local squeezy=`whence -p squeezy`
local cache="$HOME/.squeezy_zsh_completion_cache"
[ -z "$squeezy" ] && return 1
[ -x "$squeezy" ] || return 2
if ! [ -r $cache -a -s $cache ] || [ "$squeezy" -nt $cache ]
then
command squeezy -options | tr ' ' '\n' | grep '^-[a-zA-Z0-9]' > $cache
fi
[ -r $cache -a -s $cache ] || return 4
_arguments `cat $cache`
uj5u.com熱心網友回復:
運行man zshall
和搜索-nt
節目:
file1 -nt file2
如果
file1
存在并且比 更新,則為真file2
。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/471506.html