Skip to content

Instantly share code, notes, and snippets.

@turboBasic
Last active November 28, 2020 03:53
Show Gist options
  • Save turboBasic/f748b8cd2923920712ad5892e4181cd9 to your computer and use it in GitHub Desktop.
Save turboBasic/f748b8cd2923920712ad5892e4181cd9 to your computer and use it in GitHub Desktop.
Expand variables in text read from file #bash

Expand variables in text read from file

$ printf '%s\n' 'Hi, $name! Today is $day...' > something.txt

$ name=Andriy day=Friday  . <(echo -e echo $( < something.txt ))

Hi, Andriy! Today is Friday...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment