我在 MacOS 10.12 中工作,我有 100 个文件,例如:
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'
但我得到的只是文件本身的内容到标准输出。
我该怎么做呢?
最亲切的问候!