So, I am trying to check if a file exists or not, and then the script should do something if that happens. The problem I am facing is to understand that there is actually something.
if [ -e /temp/file.txt ]; then
echo "file found!"
sudo cp -r temp/* extra
else
echo "file not found! Creating new one..."
./create.sh
fi
Below is an example of files in the tested directory. they are clearly there, but for some reason I cannot get a script to see this. what am I doing wrong?
nima@mkt:/docs/text$ ls -a temp
. .. more file.txt file2.txt
source
share