if else Test if file exist
This commit is contained in:
onceupon 2017-10-25 17:59:22 +08:00 committed by GitHub
parent 81b3375b2f
commit 2226834210

View File

@ -756,6 +756,10 @@ then
fi
```
##### if else Test if file exist
```bash
if [ -e $filename ]; then echo -e "file exists!"; else mkdir $filename; fi
```
##### For loop