2/19/2023

How to stop bash shell script when it has error

set -e

refer to code:

.

#!/bin/bash

set -e

echo "Starting script..."
ls /path/that/does/not/exist
echo "This line will not be executed."

..



thank you .

www.marearts.com


No comments:

Post a Comment