#!/bin/bash CREAM_INSTALL_PREFIX=/usr remove_rainbow_wrap () { sed '/^#RAINBOW/,+1d' -i $@ } install_rainbow_wrap () { sed '1a#RAINBOW RTE0\n/usr/libexec/rainbow/rainbow-cream-wrapper-rte0.sh\n' -i $@ } for lsafile in {condor,lsf,pbs,sge,slurm}_local_submit_attributes.sh; do lsafile="${CREAM_INSTALL_PREFIX}/libexec/${lsafile}" if [ ! -s "${lsafile}" ]; then echo '#!/bin/sh' > ${lsafile} fi remove_rainbow_wrap $lsafile [ -z "$1" ] && install_rainbow_wrap $lsafile done