Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使用tr命令将单个单词更改为大写_Linux_Bash_Tr - Fatal编程技术网

Linux 使用tr命令将单个单词更改为大写

Linux 使用tr命令将单个单词更改为大写,linux,bash,tr,Linux,Bash,Tr,我在解释tr--help时遇到困难 我知道 tr [:lower:] [:upper:] <inputfile tr[:lower:][:upper:][p>sed能解决你的问题吗 sed 's/sequence/SEQUENCE/g' < inputfile sed's/sequence/sequence/g'

我在解释
tr--help
时遇到困难

我知道

tr [:lower:] [:upper:] <inputfile

tr[:lower:][:upper:][p>sed
能解决你的问题吗

sed 's/sequence/SEQUENCE/g' < inputfile
sed's/sequence/sequence/g'
如果
ghost
是您要查找的大写单词,下面的方法可能会奏效。这里
\
表示单词边界
\(
\)
描述捕获组,并
\U
大写捕获组
\1

sed 's/\(\<ghost\>\)/\U\1/g'
sed's/\(\\)/\U\1/g'

你如何定义这个词?根据它在行中的位置或其他东西/一组字符序列是我如何定义单词
tr
不做“单个单词”的。进一步定义问题。