Bash 我运行的命令在sed中运行错误
此命令在sed版本4.2.1中不起作用Bash 我运行的命令在sed中运行错误,bash,sed,Bash,Sed,此命令在sed版本4.2.1中不起作用 sed 's/[[:upper:]]/[[:lower:]]/' <file. sed的/[[:upper:][]/[[:lower:][]/'使用sed,您需要捕获组中的大写模式,然后用小写版本替换 sed -r 's/([[:upper:]])/\L\1/g' <file sed-r's/([:upper:]])/\L\1/g'使用tr代替: tr '[:upper:]' '[:lower:]' file 只是好奇,你的文件
sed 's/[[:upper:]]/[[:lower:]]/' <file.
sed的/[[:upper:][]/[[:lower:][]/'使用sed,您需要捕获组中的大写模式,然后用小写版本替换
sed -r 's/([[:upper:]])/\L\1/g' <file
sed-r's/([:upper:]])/\L\1/g'使用tr
代替:
tr '[:upper:]' '[:lower:]' file
只是好奇,你的文件的内容是什么?我知道tr存在。想知道为什么当sed支持bre时我不能使用sed。谢谢,1_CR。它成功了。我正在阅读的sed教程没有提到-r甚至\L。也许我必须再次阅读bash上的sed手册页。谢谢可爱。