I am working on some stuff where I am storing data in a file. But each time I run the script it gets appended to the previous file.
I want help on how I can remove the f
Something like this would work
#!/bin/sh if [ -fe FILE ] then rm FILE fi
-f checks if it's a regular file
-e checks if the file exist
Introduction to if for more information
EDIT : -e used with -f is redundant, fo using -f alone should work too