Last active
June 27, 2023 06:35
-
-
Save toshimaru/c480bd131c695dd3914dec7b3ea4cdc3 to your computer and use it in GitHub Desktop.
A simple bash script that checks for the existence of specified files:
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
#!/bin/bash | |
# Define the list of file paths | |
filelist=( | |
"config/database.yml" | |
"config/setting.yml" | |
"config.yml" | |
) | |
# Check for the existence of each file | |
for file in "${filelist[@]}" | |
do | |
if [ -e "$file" ] | |
then | |
echo "$file exists." | |
else | |
echo "$file does not exist." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment