DEV Community

leroykayanda
leroykayanda

Posted on • Updated on

Troubleshooting a bash script

#!/bin/bash

set -e
set -u
set -x
Enter fullscreen mode Exit fullscreen mode

set -e
Exit immediately if a command exits with a non-zero status.

set -u
Treat unset variables and parameters as errors.

set -x
Print commands and their arguments before executing them.

Save STDOUT and STDERR to user_data.log

exec &> /opt/odoo/user_data.log
set -x
echo "Hello"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)