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.
如何用该数字的两倍替换数字?
例如我有x7files并且需要x77files
x7files
x77files
我有 sed 's/[0-9]/88/'。它将 number 替换为88所以我有x88files.
's/[0-9]/88/'
88
x88files
我试过sed 's/[0-9]/[0-9][0-9]/'了,但它不起作用......
sed 's/[0-9]/[0-9][0-9]/'
尝试 ...echo x7files | sed -e's/\([0-9]\)/\1\1/g'
echo x7files | sed -e's/\([0-9]\)/\1\1/g'