From 0443168ac4d6036193dde0a2ece8fc858c732033 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Tue, 4 Jan 2022 11:37:25 -0500 Subject: [PATCH] Allow space-separated title words --- home/bin/x | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home/bin/x b/home/bin/x index 0faa918..59a4710 100755 --- a/home/bin/x +++ b/home/bin/x @@ -2,15 +2,15 @@ set -e; -name="$1"; +name=$(echo "$@" | sed 's/\s\+/-/g'); if [ "$name" != "" ]; then - timestamp=`date +'%F--%H-%M--%S'`; + timestamp=$(date +'%F--%H-%M--%S'); directory="$HOME/x/$timestamp--$name"; mkdir -p "$directory"; cd "$directory"; - echo "# $name\n" > README.md; + printf '# %s\n' "$name" > README; git init >&2 git add . >&2 git commit -m 'Initial commit' >&2 -- 2.20.1