私はMacOSの10.12で働いていますし、私はこのような100件のファイルがあります。MacOSでは、角括弧内の文字列を大文字に変換するにはどうすればよいですか?
:私はファイルを見るために大文字に> <内の項目のすべてを変換しようとしているMy file <structure_is> like this <and_maybe_like> this,
but not quite like this.
But there might be <stuff> like this, too.
は、次のようになり
My file <STRUCTURE_IS> like this <AND_MAYBE_LIKE> this,
but not quite like this.
But there might be <STUFF> like this, too.
私が使用してみました:
find . -name "\*" | xargs sed 's/\<([a-z_][^>]*)\>/\U&/g'
私もgsed(自家製)を使用して試してみました:
find . -name "\*" | xargs gsed 's/\<([a-z_][^>]*)\>/\U&/g'
しかし、私が出すのは、ファイル自体の内容が標準出力になっていることです。
どうすればよいですか?
大変お手数です。
はいです。 'sed --posix ...'を試してください。 –