Skip to content

Instantly share code, notes, and snippets.

@kotet
Last active October 5, 2018 05:40
Show Gist options
  • Save kotet/965657d6966a888ad3bf90de73142820 to your computer and use it in GitHub Desktop.
Save kotet/965657d6966a888ad3bf90de73142820 to your computer and use it in GitHub Desktop.
ディレクトリ整理
mkws() {
local dhome="$HOME"
local droot="workspace"
local ddate="$(date '+%Y/%m-%d')"
local dname="${1:-space}"
local dseparator="."
local dsalt="$(cat /dev/urandom | tr -dc 'a-z' | head -c 4)"
local d="$dhome/$droot/$ddate/$dname$dseparator$dsalt"
mkdir -p -v "$d"
cd "$d"
echo -e "\n $(pwd)\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment