Re: OT: dash - looping through alphabet

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



On Mon, Jul 7, 2014 at 12:23 AM, Ralf Mardorf
<ralf.mardorf@xxxxxxxxxxxxxx> wrote:
> On Sun, 2014-07-06 at 21:16 +0800, lolilolicon wrote:
>> for i in $(seq 97 122); do
>>   printf "\x$(printf %x $i)\n"
>> done
>
> $ bash seq-dash
> a
> b
> [snip]
> x
> y
> z
> $ dash seq-dash
> \x61
> \x62
> [snip]
> \x78
> \x79
> \x7a

I didn't know dash's printf didn't support \x. Try octal then:

for i in $(seq 97 122); do
  printf "\\$(printf %o $i)\n"
done

> $ cat seq-dash
> for i in $(seq 97 122); do
>   printf "\x$(printf %x $i)\n"
> done
>
> :(
>
> Regards,
> Ralf
>


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux