.sh script: check if file exist
Code Example - .sh script: check if file exist
#!/bin/bash
if [ -e x.txt ]
then
echo "ok"
else
echo "nok"
fi
#!/bin/bash
if [ -e x.txt ]
then
echo "ok"
else
echo "nok"
fi