dir2meme: allow user to specify dir for listing - brcon2023-hackathons - Bitreichcon 2023 Hackathon Repository
(HTM) git clone git://bitreich.org/brcon2023-hackathons git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/brcon2023-hackathons
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
---
(DIR) commit 08ed11b8a559da2751e6e348da949d01ac4353ec
(DIR) parent 514dc27e1f5c92be7292bd87a106b79f69fd026f
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sat, 12 Aug 2023 18:09:22 +0200
dir2meme: allow user to specify dir for listing
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
M memes/dir2meme | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/memes/dir2meme b/memes/dir2meme
@@ -1,13 +1,13 @@
#!/bin/sh
-if [ $# -ne 0 ];
+if [ $# -gt 1 ];
then
- printf "usage: %s\n" "$(basename "$0")" >&2
+ printf "usage: %s [dir]\n" "$(basename "$0")" >&2
exit 1
fi
printf "meme\n"
-find . -type f \
+find ${1:-.} -maxdepth 1 -type f \
| while read -r medianame;
do
case "${medianame}" in