From 8abb9894b8b4fe577a1dd514c9119a6f1285fe66 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Sat, 15 Jan 2022 22:40:18 -0600 Subject: [PATCH] touch2 now works with multiple inputs --- touch2 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/touch2 b/touch2 index fb57485..d311c30 100644 --- a/touch2 +++ b/touch2 @@ -2,5 +2,12 @@ # It makes the parent folders (if needed) while touch-ing. -mkdir -p "$(dirname "$1")" && - touch "$1" +if [ $# -ge 1 ]; then + for f in $@ + do + mkdir -p "$(dirname "$f")" + touch "$f" + done +else + echo "No filenames passed." +fi