# Debugging bash scripts

**URL:** <https://linux-tips.com/t/debugging-bash-scripts/170>\
**Category:** Programming\
**Created:** [May 31, 2008, 8:47am UTC](https://linux-tips.com/t/debugging-bash-scripts/170 "2008-05-31T08:47:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [May 31, 2008, 8:47am UTC](https://linux-tips.com/t/debugging-bash-scripts/170/1 "2008-05-31T08:47:21Z")

</div>

Bash can help us to find problems in bash scripts in some ways. You don’t expect too much or gdb like environment but it has a few helpful options.

Running a shell script with `-x` option:

```
bash -x script.sh

```

Or you can use set builtin function in shell script:

```
set -x # display executed commands and arguments
set -v # display shell input lines

```

You can also turn off this functionality as below:

```
set +x
```
