now using printf
This commit is contained in:
parent
4cc6429826
commit
f6956261b9
3
lb
3
lb
|
@ -27,9 +27,10 @@ newpost() { read -erp "Give a title for your post:
|
||||||
$EDITOR "$webdir/blog/.drafts/$url.html" ;}
|
$EDITOR "$webdir/blog/.drafts/$url.html" ;}
|
||||||
|
|
||||||
listandReturn() {
|
listandReturn() {
|
||||||
|
printf "Listing contents of %s\\n" "$1"
|
||||||
case "$(ls "$1" | wc -l)" in
|
case "$(ls "$1" | wc -l)" in
|
||||||
0) echo "There's nothing to $2." && exit 1 ;;
|
0) echo "There's nothing to $2." && exit 1 ;;
|
||||||
1) number=1 && echo "There's only one entry to $2. Defaulting selection to $(ls -rc "$1" | awk -F '/' '{print $NF}')" ;;
|
1) number=1 && printf "There's only one blog entry to %s.\\nDefaulting selection to %s\\n" "$2" "$(ls -rc "$1" | awk -F '/' '{print $NF}')" ;;
|
||||||
*) ls -rc "$1" | awk -F '/' '{print $NF}' | nl
|
*) ls -rc "$1" | awk -F '/' '{print $NF}' | nl
|
||||||
read -erp "Pick an entry by number to $2, or press Ctrl-C to cancel. " number ;;
|
read -erp "Pick an entry by number to $2, or press Ctrl-C to cancel. " number ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue