abraxas334
May 1st, 2012, 04:58 PM
After googling many things i really cannot workout, where I am going wrong.
I amtrying to print out a variable if the number is even:
My very basic script looks like this:
#!/bin/bash
echo "this will be a T-jump experiment"
for traj in {1..10} #number of cycles loop
do
modulo = $traj%2
echo $modulo
if [ $traj%2==0 ]; then
echo $traj
for temp in {1..2} #number of temperatures
do
filename="nd_temp_($temp)_tran_($traj)"
echo $filename
done
else
for temp in {2..1} #number of temperatures
do
filename="nd_temp_($temp)_tran_($traj)"
echo $filename
done
fi
done
Modulus does exist in bash but I am apparently using it wrong. I don't really understand what is wrong tho.
Thanks for any help
I amtrying to print out a variable if the number is even:
My very basic script looks like this:
#!/bin/bash
echo "this will be a T-jump experiment"
for traj in {1..10} #number of cycles loop
do
modulo = $traj%2
echo $modulo
if [ $traj%2==0 ]; then
echo $traj
for temp in {1..2} #number of temperatures
do
filename="nd_temp_($temp)_tran_($traj)"
echo $filename
done
else
for temp in {2..1} #number of temperatures
do
filename="nd_temp_($temp)_tran_($traj)"
echo $filename
done
fi
done
Modulus does exist in bash but I am apparently using it wrong. I don't really understand what is wrong tho.
Thanks for any help