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"
精彩评论