I need to redirect output to a file with > in shell, but the file should not be created if it does not already exist. How to achieve this?
I tried by creating a symlink to the file and redirecting to the symlink, but unfortunately the file is created anyway, if it does not already exist.
Probably I need to redirect to a separate program which does the checking, instead of shell. Anybody knows a program that can do this?
NOTE I need it to work in OpenWrt (i.e., with busybox's versions of utilities).