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:
parent
07a240fa8a
commit
8abb9894b8
1 changed files with 9 additions and 2 deletions
11
touch2
11
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
|
||||
|
|
Loading…
Reference in a new issue