[Nottingham] Tweaking the orientation flag in a jpeg

Camilo Mesias camilo at mesias.co.uk
Fri Sep 3 13:17:38 UTC 2010


Hi,

On Fri, Sep 3, 2010 at 12:20 PM, Martin <martin at ml1.co.uk> wrote:
> Are there easier ways to set a control code into a variable in bash
> rather than using 'echo' to interpret octal or hex escapes?

Yes, you can use the rule:

ctrl-A = 001
ctrl-B = 002 etc.

Then insert a literal character in your editor (vim) or bash command
line using the ctrl-V sequence:

a=<ctrl-v><ctrl-a>

So you type control-V then control-A and what you see is:

a=^A

but ^A is just one character (a literal control A, and you can cursor
past it in one move or delete it with a backspace).

to test:

a="$(echo -e "\001")"
b=^A
echo $a |hexdump -C
echo $b |hexdump -C

Probably not as useful as you might think, anyone abusing shell like
this probably wants a good talking to :)

-Cam



More information about the Nottingham mailing list