[xubuntu-users] dash - looping through alphabet

Ralf Mardorf ralf.mardorf at rocketmail.com
Sat Jul 5 21:04:56 UTC 2014


Hi,

since /bin/sh on *buntu usually is dash, my request might not be OT for
this list. Unfortunately I didn't find an answer in the
Internet.

What's the syntax for a loop from "a" to "z" in dash?

$ cat for-bash 
#!/bin/bash
for str in {a..z} ; do printf "$str"; done
printf "\n"
exit

$ cat for-dash 
#!/bin/dash
for str in {a..z} ; do printf "$str"; done
printf "\n"
exit

$ ./for-bash 
abcdefghijklmnopqrstuvwxyz
$ ./for-dash 
{a..z}

Regards,
Ralf





More information about the xubuntu-users mailing list