Comment 4 for bug 2052340

Revision history for this message
David Torrey (dotj) wrote :

FWIW, the difference between script calls above (direct execution vs. the pipe to `bash -x`) does appear to have the desired effect. Expanding on my test script:

$ cat > test.sh << EOF
#!/bin/bash

touch "hello"
newgrp microk8s
touch "world"
EOF

$ cat test.sh | bash -x
+ touch hello
+ newgrp microk8s

$ ls -l
total 4
-rw-r--r-- 1 tj users 0 Mar 6 14:17 hello
-rwxr-xr-x 1 tj users 58 Mar 6 14:16 test.sh*
-rw-r--r-- 1 tj microk8s 0 Mar 6 14:17 world

Something about the way `-x` works seems to have the desired effect, despite the run above not showing a line for "+ touch world" after the newgrp call.