Created
August 3, 2012 03:04
-
-
Save tomoyamkung/3243959 to your computer and use it in GitHub Desktop.
[Shell]ディレクトリの存在確認を行うスニペット
This file contains 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
#!/bin/sh | |
if [ ! -d $1 ]; then | |
echo "$1 は存在しないディレクトリです" | |
exit 1 | |
fi | |
### 次のようにすれば web ディレクトリに指定のディレクトリが存在するか、を確認できる | |
#!/bin/sh | |
if [ ! -d web/$1 ]; then | |
echo "$1 は存在しないディレクトリです" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment