Is there a way to force enable or disable debug (xtrace) per command line in scripts ?
In Windows Shell ("ms-dos") is an "@" which can prefix a command line, disabling that line to be showed if the echo (lets say debug) is enabled (echo on).
Consider xtrace on (set -x), but we could ommit its effect in some lines prefixing it lets say with "@". Like as:
set -x
@echo Listing...
ls
set +x
Output example:
Listing...
+ ls
file1
file2
Is something similar in shell scripts ?
+ 2> /dev/null
, but not R46 here for some reason. – Stéphane Chazelas Jan 18 '16 at 14:04