Tag Archive

amateur astronomy awk bash b[e] supergiant cartoon conference convert evolved star exoplanet fedora figaro fits fun galaxy history iraf large magellanic cloud latex linux lmc machine learning magellanic clouds massive star matplotlib meteor mypaper paper peblo photometry planet pro-am pyraf python red supergiant scisoft skinakas observatory small magellanic cloud smc spectroscopy starlink talk ubuntu university of crete video x-ray

Log and awk

When using the log function of awk, then what we get as a result is the natural logarithmic of the input, like:

...$ awk 'BEGIN{print log(100)}'
...$ 4.60517

So in order to obtain the logarithm of base 10 (or any other base), we just need to divide the result with the logarithm of the base, like:

...$ awk 'BEGIN{print log(100)}/log(10)'
...$ 2