Problem
I am trying to use the >> redirection to append to a file.
I issue the command:echo stuff >> notthereIf the file doesn't exist, I get the error:
notthere: No such file or directoryThis only happens when I use the csh(C). I have set noclobber. Solution
This is the way noclobber is designed to work in csh(C). Setting this option will prevent you from overwriting a file that exists, and also from appending to a file that doesn't exist.
There are 3 options:(1) You can unset noclobber. This will also allow files to be
overwritten using >(2) You can use >>! to append. This overrides noclobber for
this command only.(3) You can use the ksh(C). In ksh(C) you can set noclobber
to prevent overwriting files, but still create new files
using append.Note: in 2.x releases of SCO UnixWare, csh(1) does _not_ work
as designed, and the non-existing file will be created and
appended to when using >> . Please see IT/os 3016 for more
information.