LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-13-2012, 11:33 PM   #1
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Rep: Reputation: 2
Exclamation bash -x ... try it!


Open your terminal and enter

Code:
bash -x
Does anyone know what this is?
 
Old 03-13-2012, 11:37 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Yes, it is the x option to set, most useful for script debugging.

From the Bash man page:
Code:
              -x      After expanding each simple command, for  command,  case
                      command, select command, or arithmetic for command, dis‐
                      play the expanded value of PS4, followed by the  command
                      and its expanded arguments or associated word list.
 
Old 03-14-2012, 09:28 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
I like bash -e in my scripts, so if there's an error, it quits instead of trying to keep chugging along.

man bash
 
Old 03-15-2012, 10:39 AM   #4
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 202

Rep: Reputation: 36
bash -x is opening a bash shell AND showing the debug output.
So after that command you will have spawn another shell, and have on your screen the debuging lines of the act of spawning that shell.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Share And Discover Cool Bash Tricks With Bash One-Liners LXer Syndicated Linux News 0 01-30-2012 09:50 AM
Bash problem : -bash: [: /bin/bash: unary operator expected J.A.X Linux - Software 1 09-22-2011 05:52 AM
[SOLVED] Using a long Bash command including single quotes and pipes in a Bash script antcore Linux - General 9 07-22-2009 11:10 AM
BASH -copy stdin to stdout (replace cat) (bash browser) gnashley Programming 4 07-21-2008 01:14 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration