Skip to content

Instantly share code, notes, and snippets.

@harobed
Created August 4, 2018 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harobed/18384140fc8a34564410c64da0454c68 to your computer and use it in GitHub Desktop.
Save harobed/18384140fc8a34564410c64da0454c68 to your computer and use it in GitHub Desktop.
Print a trace of commands in bash without variable expansion
#!/bin/bash
set -T
trap 'echo "> $BASH_COMMAND"' DEBUG
i=1234
echo "$i"
(echo $i)
@harobed
Copy link
Author

harobed commented Aug 4, 2018

Output:

> i=1234
> echo "$i"
1234
> echo $i
1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment