Use nawk no Solaris.
/usr/bin/awk é o legado, não POSIX awk com o qual um script contendo apenas uma ação BEGIN não está ignorando seu stdin .
A seguinte declaração está aparecendo no manual nawk and /usr/xpg4/bin/awk , mas não no antigo awk one:
If an nawk program consists of only actions with the pattern BEGIN, and
the BEGIN action contains no getline function, nawk exits without read-
ing its input when the last statement in the last BEGIN action is exe-
cuted.
A propósito, não é necessário executar scripts head , grep, and two awk . Um script awk pode fazer tudo isso sozinho:
CPU_FREQ=$(psrinfo -v 2>/dev/null | nawk '/MHz/ {print $6/1024;exit}')