Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
上司は、CRLFシーケンスをシェルスクリプトに(彼が行っているある種のnetcatまたは何かをパイプでつなぐためtelnetに)適度に移植可能で堅牢な方法で埋め込む方法について質問をしました。
netcat
telnet
POSIXが「十分にポータブル」の適切なベースラインであると仮定すると、
printf "\r\n"
彼への私の提案:
#!/bin/sh crlf="$(echo xy | tr xy '\r\n')"
...しかし、私は他のコメントを受け入れています。最新バージョンのGNUtrと。では確かに問題ありませんbash。
tr
bash