0
我嘗試使用下面的別名,在我的.bashrc文件:ASN查找別名不能正常工作
alias ip2asn="IP=$(dig $1 a +short);whois -h v4.whois.cymru.com " -v $IP""
本身工作沒有問題的命令,但是當我創建的.bashrc別名,並嘗試源〜 ./bashrc我得到以下輸出:
$ source .bashrc
bash: alias: -v: not found
bash: alias: k.root-servers.net.: not found
bash: alias: d.root-servers.net.: not found
bash: alias: c.root-servers.net.: not found
bash: alias: e.root-servers.net.: not found
bash: alias: f.root-servers.net.: not found
bash: alias: m.root-servers.net.: not found
bash: alias: g.root-servers.net.: not found
bash: alias: b.root-servers.net.: not found
bash: alias: j.root-servers.net.: not found
bash: alias: i.root-servers.net.: not found
bash: alias: h.root-servers.net.: not found
bash: alias: a.root-servers.net.: not found
bash: alias: l.root-servers.net.: not found
我注意到,bash shell中甚至出現別名執行後要保留$ IP的變量。我不確定如何迴應這個問題。
有沒有建議嗎? 謝謝, --techno-shaman