Skip to Content.
Sympa Menu

sm-commit - Re: [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (e73e9481dcebdaf9c7114a7fbe8baa98ef201679)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <lynx AT mages.ath.cx>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: Re: [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (e73e9481dcebdaf9c7114a7fbe8baa98ef201679)
  • Date: Sat, 9 Feb 2008 19:34:37 +0100

On Saturday 09 of February 2008 16:06:47 Justin Boffemmyer wrote:
> function jump() {
> - echo "$*" >$INSTALLER_STATUS
> + local i
> + local good=0
> +
> + for i in $(cat $INSTALLER_DATA/steps | cut -d" " -f1)
> + do
> + if [[ $* = $i ]]
> + then
> + good=1
> + echo "$*" >$INSTALLER_STATUS
> + break
> + fi
> + done
Another bash tip/trick.
You can remove all the forking from this loop by reading and coping the data
with bash itself:
local the_rest
while read i the_rest
do stuff
done < $INSTALLER_DATA/steps

Ok, it is not identical to the first, since read would split on any $IFS
character, but I doubt you have tabs or newlines in there.

--
We cannot command nature except by obeying her. --Sir Francis Bacon
Have a sourcerous day! www.sourcemage.org

Attachment: signature.asc
Description: This is a digitally signed message part.




Archive powered by MHonArc 2.6.24.

Top of Page