<div dir="ltr"><div><div>It looks to me like you need a while loop.  Dash is intended to be a subset after all, and something had to be left out.<br></div><br></div>It can be a one-liner, as I gave before, or if you want spaces between the letters (but not after the last one), you can use<br>
<br>i=1; while [ $i -lt 26 ] ; do  echo -n $( echo abcdefghijklmnopqrstuvwxy | cut -c$i)' '; i=$((i+1)); done; echo z<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jul 6, 2014 at 11:14 AM, Steve Litt <span dir="ltr"><<a href="mailto:slitt@troubleshooters.com" target="_blank">slitt@troubleshooters.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Sun, 06 Jul 2014 07:26:34 +0200<br>
Ralf Mardorf <<a href="mailto:ralf.mardorf@rocketmail.com">ralf.mardorf@rocketmail.com</a>> wrote:<br>
<br>
> On Sat, 2014-07-05 at 19:49 -0400, Steve Litt wrote:<br>
> > I couldn't get anything to work without putting spaces between every<br>
> > letter from a to z.<br>
><br>
> Thank you,<br>
><br>
> but if this is needed, then I don't want to use a loop, but do it this<br>
<br>
</div>Wouldn't blame you a bit, but I can make it much easier. Read on...<br>
<div class=""><br>
> >  Would you consider a C solution?<br>
><br>
> No, it should be a shell script and for this script I prefer dash over<br>
<br>
</div>OK, how bout a partial C solution that gives Unix a much-needed "do one<br>
thing and do it well" command? The following rng executable takes a<br>
single, two letter argument, and returns a space-delimited range<br>
from the first letter to the second letter, inclusive:<br>
<br>
=============================================================<br>
#include<unistd.h><br>
<div class="">int main(int argc, char *argv[]){<br>
</div>        char buf[10];<br>
        char start = argv[1][0];<br>
        char end = argv[1][1];<br>
        char i;<br>
        for(i=start; i <= end; i++){<br>
                buf[0] = i;<br>
                write(1, buf, 1);<br>
                if(i < end)<br>
                        write(1, " ", 1);<br>
        }<br>
        return 0;<br>
}<br>
=============================================================<br>
<br>
Because the preceding doesn't include <stdio.h>, it's fairly small,<br>
6854 bytes. So rng eg returns "e f g".<br>
<br>
So, when you iterate in your shellscript, do this:<br>
<br>
=============================================================<br>
#!/bin/dash<br>
<br>
for c in `./rng az`; do<br>
        echo $c<br>
        # Do whatever else with $c<br>
done<br>
=============================================================<br>
<br>
Works equally well in dash and bash. Obviously, in real life you put<br>
rng in a directory on the path and get rid of the "./".<br>
<br>
As far as pure shellscript solutions, I tried a lot of things,<br>
including the well documented and highly spoken of:<br>
<br>
printf "%03o" ascii_number<br>
<br>
and none worked. The "%03o" thing just printed the number again.<br>
<br>
Unix really should have a chr command. Rather than making a chr<br>
command, I just made a rng command that makes your shellscript loop<br>
logic trivial.<br>
<div class="im HOEnZb"><br>
SteveT<br>
<br>
Steve Litt                *  <a href="http://www.troubleshooters.com/" target="_blank">http://www.troubleshooters.com/</a><br>
Troubleshooting Training  *  Human Performance<br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">--<br>
xubuntu-users mailing list<br>
<a href="mailto:xubuntu-users@lists.ubuntu.com">xubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/xubuntu-users" target="_blank">https://lists.ubuntu.com/mailman/listinfo/xubuntu-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Kevin O'Gorman<br><br>programmer, n. an organism that transmutes caffeine into software.<br><span style="line-height:normal;font-variant:normal;font-size:10pt;font-style:normal;font-weight:normal"><span style="line-height:normal;font-variant:normal;font-size:10pt;font-style:normal;font-weight:normal"></span></span><table border="0" cellpadding="0" cellspacing="0" width="448">
<tbody><tr><td width="25"><img src="cid:XVHDKDFDBURW.IMAGE_60.gif" height="21" width="25"></td>
<td width="423"><span style="FONT-FAMILY:Verdana,Geneva,sans-serif;COLOR:rgb(0,153,0);MARGIN-LEFT:5px;FONT-SIZE:10px">Please consider the environment before printing this email.</span></td></tr></tbody></table><br></div>

</div>