Last active
November 6, 2018 15:30
-
-
Save jasdeepkhalsa/50491d0cf46c9afde7d2bfe17e56b367 to your computer and use it in GitHub Desktop.
Extract a value from a file of key=value pairs using BASH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VAR=$(grep "MyVar" test | grep "^$MyVar" | cut -d'=' -f2-) | |
echo $VAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
something=jdiojdoijdoi | |
MyVar=GetHereIsAKey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment