Shell one-liner: Difference between revisions

Content added Content deleted
(FORTRAN entry)
Line 157: Line 157:


=={{header|FORTRAN}}==
=={{header|FORTRAN}}==
This example, stolen from the [[InternalLink|c]] example is subject to the same caveats.
This example, stolen from the [[InternalLink|c]] example is subject to the same caveats. While contrived, FORTRAN as a one liner can easily handle some unique tasks. Let's plot a Bessel function:
<lang bash>
<lang bash>
$ gawk 'BEGIN{print" write(6,*)besj1(exp(1.0))\n end";exit(0)}'|gfortran -x f77 - && ./a.out
$ gawk 'BEGIN{print"write(6,\"(2(g12.3,x))\")(i/10.0,besj1(i/10.0), i=0,1000)\nend";exit(0)}'|gfortran -x f95 - && gnuplot -p -e 'plot "<./a.out" t "Bessel function of 1st kind" w l'
0.435962617
</lang>
</lang>
[[Image:Bessel1.jpg]]


=={{header|Gema}}==
=={{header|Gema}}==