title: Sleep interval in shell script
body: <p>I've made a basic shell script, which looks for a file existence. It can get a parameter (optional) for sleep interval. If I don't give any, the default one is 60 seconds.</p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>#!/bin/bash
  
  minutes=60
  if [ "$#" -eq 1 ]; then
  re='^[0-9]+$'
  if ! [[ "$1" =~ re ]]; then
      echo $1 is not a number!
      exit 1
  fi
  else minutes=$1*60
  fi
  
  while [ ! -f uj_aru ]
  do
  last | grep Apr
  sleep "$minutes"
  done
  </code></pre>
  
  <p><strong>After</strong> running this I get this error:<br>
  <code>sleep: invalid time interval '*60'</code></p>
  
  <p>I guess here is a small mistake with the variable, but I didn't manage to figure it out.</p>