Debugging bash scripts
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
- 0 Comment
- Murat Demirten
- 31 May 2008, 11:47
-
You must be login first or sign-up for an account to post comments.
Maybe you should look at these also:
USERBOX
CATEGORIES
MOST READ TODAY
- Redirecting tcp / udp ports with socat
- Syntax highlighting in less
- Disabling reverse dns lookups in ssh
- Passwordless sudo setup
- Users with /bin/false shell to login on vsftpd
- Scp resume
- Using lsof utility
- Enabling remote desktop on a VirtualBox Machine
- XFS Filesystem has duplicate UUID problem
- Replication in MySQL
LAST ADDED
- Using iPhone internet sharing over bluetooth under Linux
- Using USB sound card with amarok
- Multi-conditional search and replace (clearing a ftp trojan script example)
- Disabling ipv6 functionality
- How to convert a mp3 file
- How to choose the fastest Debian mirror
- Disabling reverse dns lookups in ssh
- Rewriting destination ip address
- Deleting A File By It's Inode Value
- Learning which libraries are used for a binary
