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.
私は挿入しようとしています:
echo "usr_web88_2" | sed 's/^\(usr\_\)'
しかし、私は解決策を見つけることができません
私はこの文字列を持っています:
usr_web88_2
次のようにアンダースコアの前にバックスラッシュを追加します。
usr\_web88\_2
誰でも私を助けることができますか?ありがとうございました..
echo "usr_web88_2" | sed 's/_/\\_/g'
g はグローバルを意味し、最初の一致だけでなく、行で見つかった各一致に式を適用します。