Demo entry 6656543

bash script with decimal numbers

   

Submitted by anonymous on Oct 31, 2017 at 17:16
Language: Bash. Code size: 387 Bytes.

#!/bin/bash

# Note the decimals not being highlighted porperly as on complete number.
export MDV_THEME=729.8953
export A_VAR=729
export RANDOM_VAR=56.23
export DECIMAL_VALUE=89.3641

function run_test {
  cmp <($2) <($3)
  if [ $? -ne 0 ]
  then
    echo "Missmatch when running test $1:"
	echo
	echo "Command 1 [$2] output:"
	$2
	echo
	echo "Command 2 [$3] output:"
	$3
	exit 1
  fi
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).