I’m writing an shell script like these:
#!/bin/bash
x=0
y=`expr $2 / $1`
while [ $x -ne "$1" ]; do
a=`expr $y \* $x`
./validade_database.sh 1 $a $3 $4 $5 `expr $y \* $x` &
x=`expr $x + 1`
done
read inputline
The problem is that it’s calling my “validade_database.sh” just one time. I’ve tried this:
echo "./validade_database.sh 1 $a $3 $4 $5 `expr $y \* $x` &"
And it shows that it’s called $1 times.
My second problem is when I stop this script, it keeps running the “validade_database.sh” in background, how do I stop them?
You haven’t noted what
$1is.Assuming
$1is1then the script would run exactly one time.