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.
少なくとも bash パターン置換では、引用符に続くことがよく使用されます。$' 'たとえば${arr[@]/%/$'\n\n\n'}、各配列の「arr」項目の後に 3 つの改行文字を出力します。それらはある種の特別な引用ですか?彼らはどのように呼ばれていますか?bash パターン置換以外にどこで使用されますか?
$' '
${arr[@]/%/$'\n\n\n'}
ANSI-C 引用
フォームの単語は$'string'特別に扱われます。単語は文字列に展開され、バックスラッシュでエスケープされた文字は ANSI C 標準の指定に従って置き換えられます。
$'string'
例えば:
$'hello\nworld'
途中に改行11がある文字が得られます。
11
echo -e 'hello\nworld' echo $'hello\nworld'
彼らはあなたに同じ結果を与えます。