Skip to content

Instantly share code, notes, and snippets.

@teramako
Created October 6, 2011 07:55
Show Gist options
  • Save teramako/1266791 to your computer and use it in GitHub Desktop.
Save teramako/1266791 to your computer and use it in GitHub Desktop.
ディレクトリを作成して echo する関数
# 例: tar -xzvf hoge.tar.gz -C `mkdir hoge`
mkdir () {
/usr/bin/mkdir "$@"
local RC=$?
if [ ! -t 1 -a $RC = 0 ]
then
for buf in "$@"
do
[ -d "$buf" ] && echo $buf
done
fi
return $RC
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment