开发者

Display octal value without being interpreted with tr?

I have

./script "test\42"

Here is an example script :

#!/bin/sh
echo "$1"

It gives me :

test" (42 being interpreted as an ASCII octal value, 42 = ")

How can I do to display

test\42 (instead test" ?)

With the help of tr (tr开发者_运维百科anslate Unix command)?


Try either using single quotes:

./script 'test\42'

or escaping the slash:

./script "test\\42"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜