Created
November 25, 2017 06:11
-
-
Save fhuitelec/2e996b340beafae6aa9c7953983dea51 to your computer and use it in GitHub Desktop.
[Check file exists] Cheatsheet to check if file exists #zsh #shell #cheatsheet
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
#!/usr/bin/env zsh | |
# | |
# Check file exists | |
# | |
if [ ! -f /tmp/foo.txt ]; then | |
echo "File not found!" >&2 | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is helpful, thanks!