awk isn't working

awk 'BEGIN{print '1.2449'**0.5}'
awk: line 1: syntax error at or near *

can someone help me troubleshoot the above command?

i'm trying to do the square root of 1.2449. this command works on Red Hat, but for some reasonn isn't working on kubuntu (latest version).

shell is bash.

i need a command like this that will work on both linux and sunos machines.

any ideas?

On Solaris use /usr/xpg4/bin/awk rather than awk
On kubuntu, use gawk rather than mawk

or, try:

awk 'BEGIN{print 1.2449^0.5}'
1 Like

Try this:

awk 'BEGIN{print 1.2449^0.5}'
1 Like

i'll try this when i get home. thank you so much guys