0

i am somewhat forced to use an environmet i am really not used to. I have a large prepare script that generates a jobscript for our cluster. I stripped out a minimal example that shows what is not working right now.

#! /bin/ksh

EXPDIR="/home/user1/tmp/exp"
EXPNO="${testno}"

if [ ! -d "$EXPDIR" ]; then
    /client/bin/mkdir -p "${EXPDIR}"
    cd "${EXPDIR}"
fi

jobname="${jobname:-${EXPNO}}"
jobfile="${jobfile:-${EXPDIR}/${jobname}.job}"


cat >"${jobfile}" <<EOF1



#-----------------------------------------------------------------------------
# TEST 
#-----------------------------------------------------------------------------

This script should create a file called testno.job containing

#-----------------------------------------------------------------------------
# TEST 
#-----------------------------------------------------------------------------

in the directory /home/user1/tmp/exp and create the directory if it is not existing. The only problem is that the file is not called testno.job but .job. Can you help me out?

2 Answers 2

1

Obviously, the jobfile variable contains .job rather than testno.job. I think you need to set testno because it is used to produce the jobname variable.

Sign up to request clarification or add additional context in comments.

Comments

1

IMHO, you haven't defined the ${testno} variable.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.