X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Fbin%2Fx;h=59a47106a5d0f55804d983ae054fb142423cd0fd;hb=0443168ac4d6036193dde0a2ece8fc858c732033;hp=0faa9183439b103d3fc6a1bd36107446abccccf8;hpb=a5fd199fd1aa02b50d2766b23b1dcaaacde9a4f7;p=khome.git 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