News

To avoid that problem, you'll want to set -o noclobber in scripts or, better, for your login shell, and let it be inherited by subshells, including those that run your shell scripts.
The Test-Path cmdlet can keep you from going bonkers by offering a little bit of script pre-error-handling.
How do you know your shell script is error-free before you deploy it? Of course, nothing can catch all errors, but you might try ShellCheck.
Anyhow, I was writing a script and given that CTP3 now supports the good old try and catch error handling methodology. My error handling logic, of course, was using it.
It's not hard to create and run a shell script in Linux distros like Ubuntu, but there are a few non-obvious pitfalls you need to avoid. Here's a quick example of how to execute a script in Linux.