unix%:~/tmp$ cat tmp.txt
z=0.016728
NH=5.7E20
Center for spectra: 2:00:14.906, +31:25:45.826
I would like for the value of z
to be set to a variable named $redsh
, the value of NH
to be $abun
, and the values for the center to be $xc
and $yc
respectively.
How do I go about doing this?
I’d use
sed
to replace the values from the file, addset
and runeval
on the whole thing:Example run
Note however that: You shouldn't use the C shell. Use the Bourne shell.
Read
man csh;man grep;man cut;man awk;man tr
and do something like