Проверьте, существует ли файл Bash
FILE=/etc/resolv.conf
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "$FILE does not exist."
fi
Super Dude
FILE=/etc/resolv.conf
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "$FILE does not exist."
fi
$Folder = 'C:\Windows'
"Test to see if folder [$Folder] exists"
if (Test-Path -Path $Folder) {
"Path exists!"
} else {
"Path doesn't exist."
}