Horje
shell logical and for file existence Code Example
check if file exists bash
FILE=/etc/resolv.conf
if [ -f "$FILE" ]; then
    echo "$FILE exists."
else 
    echo "$FILE does not exist."
fi
Source: linuxize.com
.sh script: check if file exist
#!/bin/bash
if [ -e x.txt ]
then
    echo "ok"
else
    echo "nok"
fi
shell logical and for file existence
if [[ -f $FILE1 ]] && [[ -f $FILE2 ]]; then
    echo "OK"
fi




Shell

Related
python alias Code Example python alias Code Example
arch clavier francais Code Example arch clavier francais Code Example
bash how to define a path Code Example bash how to define a path Code Example
how to change git password in git bash Code Example how to change git password in git bash Code Example
How to install kind Code Example How to install kind Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10