$ (set -x; echo hello) &> foo.txt
$ cat foo.txt
+ echo hello
hello
Use set -x and export to a file
Question
Is there any way to export all the output of set -x
to a file?
my exercise is to use set -x
do some functions like mkdir
and touch
and export all the output to a file.
Thanks
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow