let_s_begin
New Member
i was picking apart some bash scripts online to help me practice and learn more about bash. i encountered one script that had this ((count++)) towards the end of the script. from what i can tell this says to add to the variable. i was hoping for a better explanation about what it does, why its there, and hopefully some examples of its use in other scripts.
Here's the script
#!/bin/bash
valid=true
count=1
while [ $valid ]
do
echo $count
if [ $count -eq 5 ];
then
break
fi
((count++)) #this is what i was curios about
done
Here's the script
#!/bin/bash
valid=true
count=1
while [ $valid ]
do
echo $count
if [ $count -eq 5 ];
then
break
fi
((count++)) #this is what i was curios about
done