Re: OT: dash - looping through alphabet

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



On Sat, Jul 5, 2014 at 10:44 PM, Ralf Mardorf
<ralf.mardorf@xxxxxxxxxxxxxx> wrote:
> Hi!
>
> Sorry, it's OT for this list, but I didn't find an answer in the
> Internet.
>
> What's the syntax for a loop from "a" to "z" in dash?
>
> [rocketmouse@archlinux src]$ cat for-bash
> #!/bin/bash
> for str in {a..z} ; do printf "$str"; done
> printf "\n"
> exit
>
> [rocketmouse@archlinux src]$ cat for-dash
> #!/bin/dash
> for str in {a..z} ; do printf "$str"; done
> printf "\n"
> exit
>
> [rocketmouse@archlinux src]$ ./for-bash
> abcdefghijklmnopqrstuvwxyz
> [rocketmouse@archlinux src]$ ./for-dash
> {a..z}
>
> Regards,
> Ralf
>

You can use

echo $(seq -s '' 1 9)

for number sequences, but I don't think you can do it with letters.


[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