题目1
把下面的字符串:
stu494
e222f
stu495
bedf3
stu496
92236
stu497
49b91
转为如下形式:
stu494=e222f
stu495=bedf3
stu496=92236
stu497=49b91
答案:
cat 123 |xargs -n 2|awk ‘BEGIN{RS=" ";ORS="="}{print}‘
cat 123 |xargs -n 2|tr " " "="
sed -r ‘N;s#\n#=#g‘ 123
cat 123 |xargs -n 2|sed ‘s# #=#g‘
sed -r ‘N;s#\n#=#g‘ 123
时间: 2024-12-30 02:51:37