Skip to content

Instantly share code, notes, and snippets.

@kotet kotet/mkws.sh
Last active Oct 5, 2018

Embed
What would you like to do?
ディレクトリ整理
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
You can’t perform that action at this time.