[Vm-dev] with: do: in (ba)sh scripts

Eliot Miranda eliot.miranda at gmail.com
Fri Jun 13 19:04:24 UTC 2014


Hi Timothy,

    I find this code confusing.  Bear with me?  So if one wanted to
evaluate d in newspeak.cog.spur newspeak.cog.v3 alongside p in "Newspeak
Spur Virtual Machine" "Newspeak Virtual Machine" how would you write that?

I write it via

IFS="
        "
set -- Newspeak\ Virtual\ Machine       Newspeak\ Spur\ Virtual\ Machine
for d in newspeak.cog.v3 newspeak.cog.spur; do
...
        shift
done

where IFS is lf tab.


On Fri, Jun 13, 2014 at 11:55 AM, gettimothy <gettimothy at zoho.com> wrote:

>
> Hi Eliot
>
> Hi All,
>
>
>     anyone know of the nicest way of doing with: do: in bash?  Right now
> I've found the following and I think it stinks:
>
> set -- firstone firsttwo firstthree
> for v in secondone secondtwo secondthree
> do
>     blah $1 $v
>     shift
> done
>
>
> I don't know if it is the nicest, but it is nicer.
>
> http://www.menmachinesmaterials.com/Flat/image/createFlatSourceTree.sh
>
> see 'iterate through array values' example here:
> http://www.cyberciti.biz/faq/bash-for-loop-array/
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20140613/c193099f/attachment.htm


More information about the Vm-dev mailing list