Home > Enterprise >  shell script question: { set x; } 2>/dev/null
shell script question: { set x; } 2>/dev/null

Time:07-12

experts,

I just started to study about the shell script.

And I was reading a stackoverflow page: Bash set x without it being printed

My question is simple as you see:

{ set x; } 2>/dev/null

On the shell script, what does the '{ set x; }' mean?

I already got the answers about the "2>/dev/null" so far.

but I cannot find any idea about the "{set x;}" but "set -x".

Please teach me what it is.

Thank you!

CodePudding user response:

set -x enable a mode, that prints all executed commands to the terminal.

set x disables this mode.

source

  • Related