Skip to content

Instantly share code, notes, and snippets.

@fhuitelec
Created November 25, 2017 06:11
Show Gist options
  • Save fhuitelec/2e996b340beafae6aa9c7953983dea51 to your computer and use it in GitHub Desktop.
Save fhuitelec/2e996b340beafae6aa9c7953983dea51 to your computer and use it in GitHub Desktop.
[Check file exists] Cheatsheet to check if file exists #zsh #shell #cheatsheet
#!/usr/bin/env zsh
#
# Check file exists
#
if [ ! -f /tmp/foo.txt ]; then
echo "File not found!" >&2
exit 1
fi
@jahands
Copy link

jahands commented Jun 27, 2024

This is helpful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment