Skip to content

Instantly share code, notes, and snippets.

@brianoflan
Last active December 16, 2016 17:36
Show Gist options
  • Save brianoflan/80f3aec3d3033ceab19ddab36b1dbe03 to your computer and use it in GitHub Desktop.
Save brianoflan/80f3aec3d3033ceab19ddab36b1dbe03 to your computer and use it in GitHub Desktop.
mktemp (mktmp, tmp, TMPDIR, make temporary file, make temporary folder, make tmp, make temporary dir, make temporary directory)
#!/bin/bash
mktmpd() {
local tmpd=`mktemp -d "${TMPDIR:-/tmp}/tmp.d.XXXXXXXXXX"` ;
echo "$tmpd" ;
}
MkTemp() {
local tmpf=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ;
echo "Temporary file: $tmpf" ;
local tmpd=`mktemp -d "${TMPDIR:-/tmp}/tmp.d.XXXXXXXXXX"` ;
echo "Temporary folder: $tmpd" ;
}
MkTemp ;
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment