gawk will work or not ?

Hai

I am using

bash-2.03$ bash --version
GNU bash, version 2.03.0(1)-release (sparc-sun-solaris)

I am not able to use gawk command its showing command not found , why ?

Eg:
awk 'NR==1' fix.txt | gawk 'BEGIN { FIELDWIDTHS = "3 2" } { printf($1"|"$2); }'
---------------------------------------
bash: gawk: command not found
Broken Pipe

I want to find num of columns with whitespace as field seperator, is it possible with awk

Thank u

either because it is not installed, or because it is not in the PATH.

try /usr/sfw/bin/gawk

possibly you could check it in third-party binaries

/opt/third-party/bin/gawk

Because gawk is either not installed or not in your PATH.

Why would you use both awk and gawk?

gawk 'BEGIN { FIELDWIDTHS = "3 2" }
NR==1 { printf($1"|"$2); exit}' fix.txt

If you only need the first line, you don't need awk or gawk:

read -r line < FILENAME
set -f
set -- $line
echo $#