Search Results

Search: Posts Made By: gilberteu
6,138
Posted By elixir_sinari
Like this may be: awk...
Like this may be:

awk 'BEGIN{FS="=";while(getline < "configfile") a[$1]=$2} <use variables as a["var1"],a["var2"],etc.>'
6,138
Posted By Corona688
Awk doesn't have an eval so you can't just set...
Awk doesn't have an eval so you can't just set arbitrary variable names in BEGIN.

What's your system? If you have GNU awk, you can just add 'BEGIN {' and '}' to your configfile, then do this:
...
6,138
Posted By itkamaraj
if you only have these four variables, then...
if you only have these four variables, then source your file


. variables.txt

awk -v var1="$var1" -v var2="$var2" -v var3="$var3" -v var4="$var4" '{do your process and access the vairable...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 10:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy