wlraider70
wlraider70

Reputation: 186

bash if statement issue, cannot evaluate gt

Here is a part of my bash script. I want to track that the script is running. so each time it runs the counter will increment, when the counter hits X (3 for my test) something will happen. I also want the count to reset.

The counter is incrementing,

#!/bin/bash
counter=( `cat "/home/pi/auto/mark"` )

three=3


if [ "$counter2" -gt "$three" ]; then
     echo 1 > /home/pi/auto/daycheck

Upvotes: 1

Views: 118

Answers (1)

Zombo
Zombo

Reputation: 1

I am assuming your $counter2 is a typo

(( `</home/pi/auto/mark` > 3 )) && echo 1 > /home/pi/auto/daycheck

Upvotes: 3

Related Questions