tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: printf(1), sh(1), POSIX.2 and octal escape sequences



On Wed, 28 Jun 2023, Martin Husemann wrote:

If you want to write a two digit octal number you can not continue with
another ocatal digit. In C you could do "...\77" "7" and have it concat
the literals. In config files (without concatenation) you need some
other trick.


Couple of ways to do that:

```
$ printf '\0777' | hexdump -C
00000000  3f 37                                             |?7|
00000002
$ printf '\77\067'
00000000  3f 37                                             |?7|
00000002
$
```

-RVP


Home | Main Index | Thread Index | Old Index