Writing your own C code is like to create a new linux command. You can do the first step only once, then put the executable somewhere in your path and preserve it for future uses. Step 2 can be skipped as well if the C program send the output to stdout, so that you can do something like:
but beware that bash does not support floating point numbers.
A ready alternative is to use some application which has the natural log function as a built in, like awk or bc:
Code:
my_log=$(echo "l(8)" | bc -l)
my_log=$(echo 8 | awk '{printf "%11.9f\n",log($1)}'