In my script in bash, there are lot of variables, and I have to make something to save them to file. My question is how to list all variables declared in my script and get l
Try using a script (lets call it "ls_vars"):
#!/bin/bash set -a env > /tmp/a source $1 env > /tmp/b diff /tmp/{a,b} | sed -ne 's/^> //p'
chmod +x it, and:
ls_vars your-script.sh > vars.files.save