79589307

Date: 2025-04-23 18:50:20
Score: 2
Natty:
Report link

in csh its very simple:

echo "some string" > ./file # creates file, fails if it exists

echo "some string" >> ./file # appends to file it if exists, fails if it doesn't exist

echo "some string" >! ./file # creates the file, overwrites it it exists

echo "some string" >>! ./file # appends to file, creates it if it doesn't exist

in csh you have all the control you need without setting shell vars that may have unintended consequences. Wish they'd add this to bash.

Reasons:
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: The Bear