1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-25 20:58:37 -06:00

touch2 now works with multiple inputs

This commit is contained in:
Sayantan Santra 2022-01-15 22:40:18 -06:00
parent 07a240fa8a
commit 8abb9894b8

11
touch2
View file

@ -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