Implement `exists` function for Bash