Linux 'set -x'

Posted on 2011-10-25
Last Modified: 2012-06-27
I wrote the following script:

+ cat
set -x
echo 'Point 1'
set -x
echo 'Point 2'

Open in new window

When I execute it , I get the following:

+ echo 'Point 1'
Point 1
+ set -x
+ echo 'Point 2'
Point 2

Open in new window

This site:

says that the second 'set -x' should turn off the debugging info, but that is not happening in my short script on RHEL 5.6 ksh

How can I turn off the 'set -x' in the middle of a script ?
Question by:Los Angeles1
    LVL 8

    Expert Comment

    set -x
    echo 'Point 1'
    echo 'Point 2'

    Open in new window

    LVL 68

    Accepted Solution


    set +x


    Author Closing Comment

    by:Los Angeles1
    Sorry, I misread the doc

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now