Created
October 6, 2011 07:55
-
-
Save teramako/1266791 to your computer and use it in GitHub Desktop.
ディレクトリを作成して echo する関数
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 例: 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