【发布时间】:2012-05-02 16:43:38
【问题描述】:
您好,在 x86 机器上使用以下命令(使用 /bin/sh)返回:<port>3<port>
test="port 3"
echo $test | sed -r 's/\s*port\s*([0-9]+)\s*/<port>\1<\/port>/'
但在基于 ARM 的网络交换机的 sh shell 上运行相同的命令会返回字符串 port 3。
如何在交换机上获得与在 x86 机器上相同的结果?在我看来,数字似乎没有被 [0-9] 捕获。
【问题讨论】:
标签: linux sed embedded embedded-linux