Files
hpr_website/www/eps/hpr2483/hpr2483_range_demo.sh

29 lines
668 B
Bash
Raw Permalink Normal View History

2025-10-28 18:39:57 +01:00
#!/bin/bash -
#
# Test script to run the range_parse function
#
set -o nounset # Treat unset variables as an error
#
# Source the function. In a real script you'd want to provide a path and check
# the file is actually there.
#
source range_parse.sh
#
# Call range_parse with the first two arguments provided to this script. Save
# the output in the variable 'parsed'. The function is called in an 'if'
# statement such that it takes different action depending on whether the
# parsing was successful or not.
#
if range_parse "$1" "$2" parsed; then
echo "Success"
echo "Parsed list: ${parsed}"
else
echo "Failure"
fi
exit