Disable the ">" operator in Rstudio linux terminal
>
is not a command but an operator for redirecting streams, so you can't alias it. But you can disable overwriting files with the noclobber
option. Just run set -C
or set -o noclobber
(or add them to your ~/.bashrc
)
The
noclobber
option is available to avoid overwriting existing files with output redirection (see TheSet
Builtin). The ‘>|’ redirection operator may be used to override noclobber.
If the file didn't exist it'll still be created, but at least you can avoid the worst case scenario. But you may still have problem if there are >|
in your code
If you want to completely disable the redirection, you have to use the restricted shell but that'd result in an extremely limited environment, most notably you can't run commands with slashes like /bin/ls
or change the directory
The best solution is to change the "run in terminal" shortcut in RStudio which was explain clearly in their website