Horje
check if file exists bash 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




7

Related
for loop typescript Code Example for loop typescript Code Example
loop from 1 to number typescript Code Example loop from 1 to number typescript Code Example
how check is file exist linux Code Example how check is file exist linux Code Example
angular date pipe Code Example angular date pipe Code Example
how to run typescript file Code Example how to run typescript file Code Example

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