Variable assignment in bash
Posted
by Werner
on Stack Overflow
See other posts from Stack Overflow
or by Werner
Published on 2010-03-16T13:30:24Z
Indexed on
2010/03/16
13:36 UTC
Read the original article
Hit count: 295
bash
Hi,
this is probably a very stupid question; in a bash script, given the output of, for instance;
awk '{print $7}' temp
it gives 0.54546
I would like to give this to a variable, so I tried:
read ENE <<< $(awk '{print $7}' temp)
but I get
Syntax error: redirection unexpected
Could you tell me why, and what is the easiest way to do this assignment?
Thanks
© Stack Overflow or respective owner