Last active
August 29, 2015 14:18
-
-
Save jegade/ae649da999d7daf72a09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# If this script is running as /usr/local/bin/perlbrew-cron | |
# then you would need to have a crontab something like: | |
# | |
# MAILTO=you@example.com | |
# PATH=$PATH:/usr/local/bin | |
# 0 * * * * perlbrew-cron ~/path/to/perl_cron.pl arg1 'arg 2' arg3 | |
export PERLBREW_ROOT=${PERLBREW_ROOT:=/opt/perl5} | |
export PERLBREW_HOME=${PERLBREW_HOME:=$HOME/.perlbrew} | |
builtin source ${PERLBREW_HOME}/init | |
export PATH=$PERLBREW_PATH:$PATH:/bin | |
builtin source ${PERLBREW_ROOT}/etc/bashrc | |
_cmd="$1" | |
shift | |
_args="'$1'" | |
shift | |
for i in "$@" | |
do | |
_args="${_args} '$i'" | |
done | |
_command="perl $_cmd $_args" | |
bash -c "$_command" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment