如何编写此命令行?
我正在使用oh-my-zsh。
我想制作ZSH命令mx google.com
,
并运行以下内容:
dig +short mx $1
然后,如果我
a p
在“ p”代表“以前”的地方运行(我在此处向其他更常见的约定开放)
我希望它运行(假设是否以前的行输出3 IP):
dig + short a ip1
dig + short a ip2
dig + short a ip3
对于每个结果,返回了上一个命令中。
我要支持上述约定的命令是a
,txt
,mx
,cname
这是当前全部我有:
alias a='f() { dig +short a $1 };f'
但是我不确定如何结合两者。
I'm using oh-my-zsh.
I want to make a zsh command mx google.com
And have it run the following:
dig +short mx $1
And then if I run
a p
where 'p' stands for "previous" (I'm open to other more common conventions here)
I want it to run (hypothetical if previous line outputs 3 IPs):
dig + short a ip1
dig + short a ip2
dig + short a ip3
for each result returned in the previous command.
The commands I want to support with the above convention are a
, txt
, mx
, cname
This was currently all I had:
alias a='f() { dig +short a $1 };f'
but I am not sure how to combine the two.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论