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.
私はsedの初心者で、次の文字列を置き換えようとしています:
a_b0_24[0][1]に変更する必要があります a_b0_24_0__1_
a_b0_24[0][1]
a_b0_24_0__1_
カッコ内は数字のみ。括弧の前のテキストは、数字、アルファベット、またはアンダースコアのみです。
ありがとう
という名前の bash 変数にテキストがあるとしますTEXT。
TEXT
$ echo $TEXT | sed -e 's/\[\|\]/_/g'
それを分解するには: