echo \"text\" >> \'Users/Name/Desktop/TheAccount.txt\'
How do I make it so it creates the file if it doesn\'t exist, but overwrites it if it
If your environment doesn't allow overwriting with >, use pipe | and tee instead as follows:
echo "text" | tee 'Users/Name/Desktop/TheAccount.txt'
Note this will also print to the stdout. In case this is unwanted, you can redirect the output to /dev/null as follows:
echo "text" | tee 'Users/Name/Desktop/TheAccount.txt' > /dev/null