title: Absolute value of a number
body: <p>I want to take the absolute of a number by the following code in bash:</p>
  
  <pre><code>#!/bin/bash
  echo "Enter the first file name: "
  read first
  
  echo "Enter the second file name: "
  read second
  
  s1=$(stat --format=%s "$first")
  s2=$(stat -c '%s' "$second")
  
  res= expr $s2 - $s1
  
  if [ "$res" -lt 0 ]
  then
          res=$res \* -1
  fi
  
  echo $res
  </code></pre>
  
  <p>Now the problem I am facing is in the if statement, no matter what I changes it always goes in the if, I tried to put <code>[[ ]]</code> around the statement but nothing.</p>
  
  <p>Here is the error:</p>
  
  <pre><code>./p6.sh: line 13: [: : integer expression expected
  </code></pre>