UrbanPaganism : PrayerWheel

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Most recent edit on 2006-05-09 15:22:16 by JohnD [Added comments for clarity.]

Additions:
until [ "$loop" -gt "$1" ] # Loop until we reach the number of repetitions
echo $2 > /dev/null # Do the magic - echo the prayer to /dev/null
if [ `expr $loop % 100` -lt 1 ] # Only display a . every 100 cycles
if [ `expr $loop % 5000` -lt 1 ] # Only display the cycle number every 5000 cycles


Deletions:
until [ "$loop" -gt "$1" ]
echo $2 > /dev/null
if [ `expr $loop % 100` -lt 1 ]
if [ `expr $loop % 5000` -lt 1 ]




Edited on 2006-05-09 06:44:33 by JohnD [Adding categories.]

Additions:

Categories
CategoryTechnopaganism
CategoryMagicalTechniques




Edited on 2006-05-09 05:06:21 by JohnD [Updated code to latest version: now counts off every 5000 cycles and takes a new line.]

Additions:
# Revised 9th of May, 2006.
if [ `expr $loop % 5000` -lt 1 ]
echo $loop

Deletions:
# Revised 28th of May, 2005.



Edited on 2006-05-09 01:50:43 by JohnD [Added bit about repetition speed]

Additions:
The speed at which it gets through a set number of repetitions will vary wildly according to your computer's capability. By default it only displays one dot per 100 cycles - I'm considering changing this as to get a 12 hour run on newer, faster hardware (the server running this site) is going to take on the order of fifteen million repetitions.



Oldest known version of this page was edited on 2006-05-08 23:09:44 by JohnD [Created page with code and some description.]
Page view:
Prayer Wheel is a short BASH script designed to be a sort of electronic prayer wheel. It sends the prayer to /dev/null (the unix device that silently drops all input -- this can be equated to a sort of black hole, or always-empty trash) for a specified number of repetitions.

I've used this to effectively provide continued 'power' for other work - in particular for a protection ritual which I wanted to remain energised and 'active' overnight, when I wasn't actively focussing on it.

#!/bin/bash
# Prayer Wheel prototype 1
# Usage: ./prayer_wheel <reps> <message>
# Example: ./prayer_wheel 500000 "Protect Her"
#
# Script echoes <message> to /dev/null for set number of repetitions.
#
# Created on the 10th of March, 2004.
# Created by John Daniels.
#
# Revised 28th of May, 2005.
#
# This script is covered by your choice of version of the GPL.

if [ -z "$1" ]; then
              echo "usage: $0 <reps> <message> (1)"
              exit
fi

if [ -z "$2" ]; then
              echo "usage: $0 <reps> <message> (2)"
              exit
fi

loop=1

echo "Prayer For: $2"
echo ". = 100 cycles"

until [ "$loop" -gt "$1" ]
do
        echo $2 > /dev/null
 if [ `expr $loop % 100` -lt 1 ]
 then
        echo -n "."
 fi
        loop=`expr $loop + 1`
done

echo
echo "Prayer Completed." 
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.1 :: Hosted by Fandomain
Page was generated in 0.0463 seconds