I'm writing a script (TEST.sh) that must run another script (TASK.sh)... Task.sh need two input... so I was thinking to redirect input from a file (I need to automize everything)...

So, I was using theese solutions:

exec "$assessment_tests/task.sh" "$parameters" < "$testdir/stdin" > "$testdir/output2";

But I receive an "access denied" error

And this other solution

bash "$assessment_tests/task.sh" "$parameters" < "$testdir/stdin" > "$testdir/output2";

(I've changed exec with bash)

In the second way i can run the script task.sh but in output2 i always find the message "Input wrong" where "Input wrong" is the output of task.sh... But I should obtain "Input ok"...

My stdin file is just a row with the value "my_input"

Any suggestion?


  • Yes. Post the script in paste.ubuntu.com and add a link here. Without knowing what it does, how can we know what's going wrong?
    – muru
    Aug 29, 2014 at 9:46
  • Honestly it was a bit complex... Here the code of task.sh paste.ubuntu.com/8177422 and here the input CD1243423kk,0dc3dopwlz
    – Simone
    Aug 29, 2014 at 10:24

1 Answer 1


Your string CD1243423kk,0dc3dopwlz doesn't pass the if statement:

if [[ ! $input =~ ^[a-k][a-kC-Z0-9]{4,},[a-z0-9]{3,}$ ]]; then
    echo "Errore Autenticazione";
    exit 21;

Fix that and you fix your problem.

Remember that it's case sensitive. The first group needs to be [a-kA-K] and then your string will pass.

  • :O Thanx... Oh my God I had tested the single file but in the end i took a wrong input :( im sorry
    – Simone
    Aug 29, 2014 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .