I just began with Shell script (#!/bin/bash) language. And here is a script:
for ((i=1;i<=200;i++)); do
if[$i>10] && [$i<50]; then
echo "Hello";
else
echo "Hi";
fi
done
It doesn't work, and I don't know why. Please help!
I just began with Shell script (#!/bin/bash) language. And here is a script:
for ((i=1;i<=200;i++)); do
if[$i>10] && [$i<50]; then
echo "Hello";
else
echo "Hi";
fi
done
It doesn't work, and I don't know why. Please help!
I can certainly help with the syntax. Look at below corrected version and you'll figure out the things that you are missing.
#!/bin/sh
for (( i = 1; i <= 200; i++ ));
do
if [[ $i -gt 10 ]] && [[ $i -lt 50 ]]; then
echo "Hello";
else
echo "Hi";
fi
done