~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/services/a-rex/lrms/slurm/configure-SLURM-env.sh

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-05-08 13:48:03 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20130508134803-mrhc5w4d5y7ubyj4
Tags: 3.0.1-1
3.0.1 Release

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
sbatch="$SLURM_BIN_PATH/sbatch"
38
38
 
39
39
# Verifies that a SLURM jobid is set, and is an integer
40
 
function verify_jobid {
 
40
verify_jobid () {
41
41
    joboption_jobid="$1"
42
42
    # Verify that the jobid is somewhat sane.
43
43
    if [ -z ${joboption_jobid} ];then
45
45
        return 1
46
46
    fi
47
47
    # jobid in slurm is always an integer, so anything else is an error.
48
 
    if [ "x" != "x$(sed s/[0-9]//g <(echo ${joboption_jobid}))" ];then
 
48
    if [ "x" != "x$(echo ${joboption_jobid} | sed s/[0-9]//g )" ];then
49
49
        echo "error: non-numeric characters in joboption_jobid: ${joboption_jobid}" 1>&2
50
50
        return 1
51
51
    fi