📝 Added argument check to cpr scriptt

This commit is contained in:
z3rOR0ne 2022-11-12 16:31:44 -08:00
parent 55f801cb91
commit d69685fee9

View file

@ -1,6 +1,12 @@
#!/bin/bash
main() {
if [ $# -lt 1 ]; then
printf "not enough arguments given\n\
usage: cpr file_to_copy\n"
exit 1
fi
orig_file="$1"
read -e -r -p "how many copies of $orig_file would you like to make?: " num_copies
parsed_file_name=$(echo "$orig_file" | awk -F. '{print $1}')