help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] bash with the -x option


From: Dennis Williamson
Subject: Re: [Help-bash] bash with the -x option
Date: Wed, 9 Sep 2015 20:10:52 -0500

On Wed, Sep 9, 2015 at 7:49 PM, Michael Convey <address@hidden> wrote:

> In the following example, what does the -x option do?
> $ p='*' bash -xc 'ls $p'
> Source:
>
> http://unix.stackexchange.com/questions/210036/filename-expansion-find-utility-pattern-matching-vs-bash-shell-pattern-matching
>
> I can't find this option in the bash man page or anywhere online.
>

$ help set | grep -- '-x'
              xtrace       same as -x
      -x  Print commands and their arguments as they are executed.
          The -x and -v options are turned off.

In the man page under "set" under "SHELL BUILTIN COMMANDS".

At http://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin

If you do bash --help, you get this near the bottom:

Type `bash -c "help set"' for more information about shell options.

In your example, it outputs the ls command with the glob expanded (so ls
followed by a list of filenames, assuming that there are any and no other
options modify the globbing). The command will be preceded by the contents
of the PS4 variable according to conditions here:
http://www.gnu.org/software/bash/manual/bash.html#Bash-Variables

-- 
Visit serverfault.com to get your system administration questions answered.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]