AWK: how to read columnwise file to AWK-script in Bash?

Posted by HH on Stack Overflow See other posts from Stack Overflow or by HH
Published on 2010-04-22T03:31:59Z Indexed on 2010/04/22 3:33 UTC
Read the original article Hit count: 233

Filed under:
|
|
|
$ cat read.sh 
#!bin/bash

// how can I read the columnwise data to awk-script?
awk '{sum+=$1} END {print sum}' read
$ cat data 
1
2
3
4
5
$ . ./read.sh <data
awk: cmd. line:1: fatal: cannot open file `read' for reading (No such file or directory)

© Stack Overflow or respective owner

Related posts about awk

Related posts about bash