Skip to content

Instantly share code, notes, and snippets.

@pysysops
pysysops / number2roman.sh
Created November 27, 2018 19:02
Convert numbers to Roman numerals
#!/bin/bash
set -eu -o pipefail
number=$1
# Test that it is valid
[[ "${number//[0-9]/}" == "" ]] || \
{ echo Number ${number} contains invalid characters ; \
exit 1 ;}