linux - How to extract a variable assignment from within a string -
i trying extract variable assignment file defined within larger string in external file /home/user/file.txt:
export os_username=xxxxx
i want "source" file , pull variable assignment script treats as:
os_username=xxxxx
i pipe variable command running on script.
config -- "$os_username" --test --run
can explain me how can pull variable assignment external file?
in script
#! /bin/bash source /path/to/file.txt # variables set command command ...
Comments
Post a Comment