Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Awesome. I will try that out. I've not used the declare yet. I've just been trying with sed and read. Will this permanently add the variable INTERNAL="/path/to/destination" \n EXTERNAL="/path/to/destination" ? I also want to implement a custom path variable. If this doesn't work, I'm debating using df -hx tmpfs --output=source,target with a select loop. I think that might be better anyway. It'll show the mounted devices so they're not stuck to just those two paths. I'll upload the script to Github so you guys can see. I'll drop the link when I do. Commented Dec 22, 2019 at 23:23
  • @alexProvencher If you use declare -p INTERNAL EXTERNAL >somefile, then two declare commands are written to the file somefile. If you later source that file, those commands will be executed and this creates the variables with the exact data that they had when you ran the declare -p command with them. Commented Dec 22, 2019 at 23:46