我遇到了一个 Zsh 脚本,想知道它的含义。在下面的脚本中有${$(@f)$(egrep "$2","$file")}
表达式。从我搜索到的,@
是使用代表所有位置参数,但是f
上面脚本中的任何地方都没有提到后缀字母,我找不到任何在线资料说明其特殊含义。
#!/usr/bin/env zsh
tmp_file="/tmp/_unsorted_find_n_grep"
echo "--- find <$2> in <$1>" > $tmp_file
find . -follow -iname "$1" | while read file
do
timestamp=$(ls -l --time-style=+"%Y-%m-%d %H:%M:%S" "$file" | gawk '{print $6, $7}')
linestack=${(@f)$(egrep "$2" "$file")}
for line in $linestack
do
echo "$timestamp $file: $line" >> $tmp_file
done
done
cat $tmp_file | sort
rm $tmp_file
Run Code Online (Sandbox Code Playgroud) 这些文件列在需要 javascript 上运行的表中click.submit()
。wget 在这种情况下不起作用。