[英]Use sed to replace string with whois command output
我有一個文本文件,包含字符串${whois}
。
我希望將${whois}
替換${whois}
IP地址或域的whois
命令輸出。 whois
的結果相當長,通常我嘗試過的所有操作都會出錯。
我收到諸如unterminated 's' command
或invalid regular expressions
錯誤。
誰能提供給我一個有效的命令,用域或IP地址的whois
輸出替換關鍵字${whois}
?
嘗試
$ whois > whois_out.txt
$ sed -e '/${whois}/r whois_out.txt' -e '//d' input_file.txt
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.