Linux 'set -x'

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

+ cat a.sh
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

Expert Comment

ID: 37024929
set -x
echo 'Point 1'
echo 'Point 2'

Open in new window

LVL 68

Accepted Solution

woolmilkporc earned 2000 total points
ID: 37024942

set +x


Author Closing Comment

by:Los Angeles1
ID: 37025033
Sorry, I misread the doc

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

830 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