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*

4
  • You may find envsubst helpful - see for example Replace environment variables in a file with their actual values? Commented Nov 27, 2019 at 2:41
  • Thanks steeldriver!!! Never heard of that utilty. Got it to work using your tip: Commented Nov 27, 2019 at 3:20
  • for i in cat mylist.txt do i=$(echo $j | envsubst) if [[ -O $i ]] && [[ -d $i ]]; then echo "found it: $i (ie, $j)" break else echo "$i is not it." fi done Commented Nov 27, 2019 at 3:21
  • I'd actually suggest running envsubst on the whole file - see answer below Commented Nov 27, 2019 at 3:30