0

I have a bash script that has to run the same file (c execut) but with different argument of input and save the output files of the c simulation in different folders. I wrote this but I don't know why it is not working!

mu=1
num=0
while test $num -le 6;do
    mkdir $num
    cd $num
    while test $mu -le 100; do
            ./infosimul "$num" "$mu" 
            mu=$((mu+3))
        done
    mu=0
    cd ../
    num=$((num+1))
done

and the oputput is:

testBash.sh: 7: testBash.sh: ./infosimul: not found

but if I run just

./infosimul: 1 3

works properly.

I am an UBUNTU user!

1
  • 2
    You change the dir by doing cd $num So infosimul is not there in the current directory. Commented May 20, 2014 at 10:56

1 Answer 1

3

Your script is changing directory by calling cd $num and the infosimul program doesn't exist in the new directory.

Try calling ../infosimul instead or specify the full path to infosimul.

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

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.