From 1ed5ea966c9e6e01f5df441e7fd89ba18dc14153 Mon Sep 17 00:00:00 2001 From: Rockingcool Date: Mon, 21 Nov 2022 08:29:33 -0600 Subject: [PATCH] Updated script to accept arguments --- screenshoot.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/screenshoot.sh b/screenshoot.sh index 00471dd..5c73195 100755 --- a/screenshoot.sh +++ b/screenshoot.sh @@ -1,6 +1,14 @@ #!/bin/bash +VAL_TO_USE=1; +if [ $# -eq 0 ] +then + echo "No arguments supplied. Assuming default value of 1." + +else + VAL_TO_USE=${1} +fi sleep 1 -for i in 1 2 3 4 5 6 7 8 9 10 +for (( i = 1; i <= $VAL_TO_USE; i++ )) do sleep 1 xdotool key Print