Answer the question
In order to leave comments, you need to log in
How to check the presence of files by mask in a condition?
Let there be a file Y , with the extension .abcdefg. Note that the file Y . If they are in folder X, output: Good. I found it!. If they are not in it - Sorry. I don't find them.
I know bash has conditions. As a result, if there is one file, something like this should come out:
myfile="/way/to/file/file.abcdefg"
if [ -f "$myfile" ]; then
echo "Good. I fin'd it!"
else
echo "Sorry. I don't find them."
fi
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question