[Vm-dev] finding the latest vm dir on linux

Yoshiki Ohshima Yoshiki.Ohshima at acm.org
Mon Aug 1 19:00:53 UTC 2016


I can think of to make the related part in /usr/bin/squeak look like:

-------------------------------
# find the latest vm
ls /usr/lib/squeak/5.0-?????*/squeak > /dev/null 2>&1
if [ $? -ne 0 ]; then
  VM=`ls /usr/lib/squeak/5.0-*/squeak | sort -r | head -1`
else
  VM=`ls /usr/lib/squeak/5.0-?????*/squeak |  sort -r | head -1`
fi
# echo $VM
-------------------------------
A bit redundant, but seem to work.


On Thu, Jul 28, 2016 at 2:49 PM, tim Rowledge <tim at rowledge.org> wrote:
>
> I need some shell script help for the upcoming Pi release; we’ve recently changed how the vm directory is named, from /usr/lib/squeak/5.0-abcd 4-digit svn update number based to /usr/lib/squeak/5.0-2016…. date-of-something-in-iso based.
>
> Clearly a naive `ls /usr/lib/squeak/5.0-*/squeak | sort -r | head -1` isn’t going to be helpful if we happen to have an older directory as well as a recent one. So, how does one discriminate effectively?
>
> I’ve considered maybe searching for 5.0-20* so we ‘limit’ ourselves to vms from this century :-) Any neater ways? Is there a way to drop 4-or-less-digit results? Some other magic?
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: RIW: Re-Invent Wheel
>
>



-- 
-- Yoshiki


More information about the Vm-dev mailing list