Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I typed set -x in terminal.

Now the terminal keeps printing the last command run on top of my output so the command

~]$echo "this is what I see"

returns

+ echo 'this is what I see'
this is what I see

There is no man page for set, how do I turn set -x off?

share|improve this question
3  
set is a shell builtin command (at least in bash it is), so the documentation is found in bash's man page. Search the man page for /^ *SHELL BUILTIN COMMANDS to read all about set and its friends! –  dg99 Aug 7 at 19:25
2  
but there is a man page for set! It is part of the POSIX programmers guide... You should really get that series... please? –  mikeserv Aug 7 at 20:55
1  
In Bash, type help set. –  200_success Aug 7 at 22:28
    
@lonewarrior556 if you find any of the answer helpful, can you please comment and/or mark a solution. We contribute our time to assist.... –  Simply_Me Aug 8 at 20:39

3 Answers 3

up vote 9 down vote accepted
$ type set
set is a special shell builtin

Since set is a shell builtin, it is documented in the documentation of your shell.

Beware that some systems have man pages for shell builtins, but these man pages are only correct if you're using the default shell. On Linux, you may have man pages that present POSIX commands, which will turn up for shell builtins because there's no man page of a standalone utility to shadow them; these man pages are correct for all Bourne-style shells (dash, bash, *ksh, and even zsh) but typically incomplete.

See Reading and searching long man pages for tips on searching for a builtin in a long shell man page.

In this case, the answer is the same for all Bourne-style shells. If set -LETTER turns on an option, set +LETTER turns it off. Thus, set +x turns off traces. The last trace that reads set +x is unavoidable (except by letting the shell exit — sometimes you can use a subshell (set -x; command to trace; other command to trace); command that is not traced).

share|improve this answer

You can stop debugging mode by set +x. See example page

share|improve this answer

Extract form help set:

Using + rather than - causes these flags to be turned off.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.