As title,
Assume I have a file name : test.txt , also have another file in the directory (ex tet.txt , ttst.txt)
I want to write a script in order to not replace the content if file exist
Here is the script
#!/bin/bash
[[ -e /home/paul/*est.txt ]] || cat > "/home/paul/test.txt" << EOF
16
EOF
but I don't know why *
(wildcard) doesn't work, it always change the content as file exists.
I also try add ''
and ""
or $
with wildcard but doesn't work
How should I use the wildcard *
?
Thank you in advance for any help you can provide!!