facebook twitter hatena line email

「Mac/インストール/sed」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(aiueo文字を改行へ)
(aiueo文字を改行へ)
行10: 行10:
 
<pre>
 
<pre>
 
LF=$'\\\x0A'
 
LF=$'\\\x0A'
gsed -i -z 's/aiueo/ai'"$LF"'ueo/g'
+
gsed -i -z 's/aiueo/ai'"$LF"'ueo/g' test.cs
 
</pre>
 
</pre>

2023年11月18日 (土) 03:51時点における版

インストール

$ brew install gsed

使い方

gsed -i "s/hoge/piyo/g" hoge.txt

Linux/コマンドメモ/sed [ショートカット]

aiueo文字を改行へ

LF=$'\\\x0A'
gsed -i -z 's/aiueo/ai'"$LF"'ueo/g' test.cs