From: Siraaj Khandkar Date: Tue, 4 Jan 2022 16:37:25 +0000 (-0500) Subject: Allow space-separated title words X-Git-Url: https://git.xandkar.net/?p=khome.git;a=commitdiff_plain;h=0443168ac4d6036193dde0a2ece8fc858c732033 Allow space-separated title words --- 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