diff options
Diffstat (limited to 'resize.sh')
| -rwxr-xr-x | resize.sh | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -6,6 +6,18 @@ if [ -z $1 ] then reduce=25 else reduce=$1 + re='^[0-9]+$' # reg expression for digits only + if ! [[ $reduce =~ $re ]] + then + echo "Usage: If you use arguments, arg 1 (resize percentage) must be an integer" + exit 1 + else + # arg1 is an integer + if [ $reduce -gt 99 ] || [ $reduce -lt 1 ] ; then + echo "Usage: reduction percentage must be between 1 and 99 percent" + exit 1 + fi + fi fi # Check for folder name in command line (no spaces of course!) |
