0

CentOS on a shared website hosting environment (I don't know the version) with Bash 5.0.17(1).

I use set -x to get maximal trace which often helps me handle errors; I normally use this command combination:

set -x && complete -r 

complete -r hides some very messy output I never found useful.

I want that the command combination will always be on, in all sessions but I am not sure in which file it is best to put it, perhaps:

  • .bashrc
  • .profile
  • .bash_profile
  • Possible similar files (files which allow to commands to run after boot, at least for some users)
1
  • You probably only need to add it to ~/.profile and nowhere else, but the details depend on your operating system. Please edit your question and tell us what operating system you are using and, if Linux, which distribution. Commented Feb 19, 2021 at 17:06

1 Answer 1

0

Rather than turning on debugging for all your scripts (and being buried in more debugging info than you can handle),

  1. Create a directory, say $HOME/.user-debug.

  2. In each script you want to debug:

    # get the name of this script me=${0##*/} if [[ "$HOME/.user-debug/$me" ]] ; then source "$HOME/.user-debug/$me" fi 

and put your debugging in the files in $HOME/.user-debug/scriptname.

That way, you can turn off debugging by removing the file in $HOME/.user-debug/scriptname.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.