I am trying to read one line at a time from the file “filelist” using “getline”.
$ cat filelist
mrrb_bed_typ_lkup;Y;v01r00;brmvx301
mrrb_drg_benchmark;Y;v01r00;brmvx302
mrrb_hin_mkt_lkup;Y;v01r00;brmvx303
mrrb_icd_procd_lkup;Y;v01r00;brmvx304
mrrb_msa_lkup;Y;v01r00;brmvx305
$ vi awk_list
#!/usr/bin/awk -f
set -vx
while ( (getline var < "filelist" ) > 0) {
print var
}
$ .awk_list
syntax error The source line is 8.
The error context is
>>> while <<< ( (getline var < "filelist" ) > 0) {
awk: Quitting
The source line is 8.
$ cat filelist
mrrb_bed_typ_lkup;Y;v01r00;brmvx301
mrrb_drg_benchmark;Y;v01r00;brmvx302
mrrb_hin_mkt_lkup;Y;v01r00;brmvx303
mrrb_icd_procd_lkup;Y;v01r00;brmvx304
mrrb_msa_lkup;Y;v01r00;brmvx305
$ vi awk_list
#!/usr/bin/awk -f
set -vx
while ( (getline var < "filelist" ) > 0) {
print var
}
$ .awk_list
syntax error The source line is 8.
The error context is
>>> while <<< ( (getline var < "filelist" ) > 0) {
awk: Quitting
The source line is 8.