Skip to content

Instantly share code, notes, and snippets.

@kotet
Last active October 5, 2018 05:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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