cdtmp
This commit is contained in:
parent
be0536de0b
commit
6f60a95167
18
zsh.d/50_cdtmp.zsh
Normal file
18
zsh.d/50_cdtmp.zsh
Normal file
@ -0,0 +1,18 @@
|
||||
# vim: ft=zsh
|
||||
|
||||
function cdtmp {
|
||||
if [ -z "$MY_TEMP_DIR" ]; then
|
||||
newtmp
|
||||
fi
|
||||
cd "$MY_TEMP_DIR"
|
||||
}
|
||||
|
||||
function newtmp {
|
||||
export MY_TEMP_DIR="$(mktemp -d)"
|
||||
echo "new tmp dir in $MY_TEMP_DIR"
|
||||
}
|
||||
|
||||
function cdnewtmp {
|
||||
newtmp
|
||||
cdtmp
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user