#!/bin/sh - #mod version 10052k3-a ## This piece of cruft was kludged together from a slightly used copy of ## CPUJOB, some string, a little glue, half a dozen rusty nails, and a $.69 ## incantation that is supposed to bring the dead back to a semblance of ## shambling life by vmorgo. The original work is copyright as below... ## So if this thing don't work, it's not their fault. ## ## Does not specify whether the job is CPU or I/O intensive. ## Copyright (c) 2000, Amnon BARAK (amnon@cs.huji.ac.il). All rights reserved. ## Buggered (c) 2003, Aaron Freed (afreed@alabang.dyndns.org). All rights ## reserved to Amnon BARAK (See above). Buggered to work properly with ## clusterknoppix and relocation of mosrun from /bin to /usr/bin. (See ## line 40 or so....) ## ## Permission to use, copy and distribute this software is hereby granted ## under the terms of version 2 or any later version of the GNU General Public ## License, as published by the Free Software Foundation. ## ## THIS SOFTWARE IS PROVIDED IN ITS "AS IS" CONDITION, WITH NO WARRANTY ## WHATSOEVER. NO LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING ## FROM THE USE OF THIS SOFTWARE WILL BE ACCEPTED. ## # Author(s): Amnon Shiloh, Ariel Rosenblatt, Moshe Bar # Slight buggering by afreed ("Vance") to make it reflect that mosrun is in # /bin, not /usr/bin, so if this script don't work no more, it's my fault, not # that of the original authors. #### #### # # USAGE--give some useful information on how this is used. # #### #### function usage() { echo "Usage: `basename $0` [-{h|MOSIX_ID}] [-z] command [ arg ... ]" echo "NOTE: You need to specify the full distinguished pathname to" echo "the command you wish to run." echo " " echo "NOTE: If this program fails due to missing \"which\" command, you" echo "will need to edit the 2nd to last line and put in the exact location" echo "of mosrun." exit 1 } ######################################################## case "$1" in -[1-9]|-[1-9][0-9]|-[1-9][0-9][0-9]|-[1-9][0-9][0-9][0-9]|\ -[1-9][0-9][0-9][0-9][0-9]|-h) where=$1 shift ;; esac case "$1" in -z) zflg=-z shift case "$#" in 1) echo "`basename $0`: '-z' requires an argument." exit 1 ;; esac ;; esac case $#,"$1" in *,-*|0,*) usage ;; esac MOSRUN=`which mosrun` exec $MOSRUN $where -L $zflg $*