I have a file /tmp/gish.dat which either contains a number (more than 0, and one or more digits) or nothing.
If there is a number present, I want my function to echo a # along with the number (eg #64). If there is no number present, I want my function to do nothing.
   get_issue() {
        if [ -f "/tmp/gish.dat" ]
        then
            iss=$(cat /tmp/gish.dat | grep -Eo '[0-9]+')
            if [[ iss =~ '[0-9]+' ]]
            then
              echo "#$iss"
            fi
        fi
    }
For some reason, the inner if never matches. Very new to bash.
 
     
     
    