-1

I want to call Code.c from within awk. Note that the Code.c takes current record (i.e. $0) as argument.

I am new to shell scripting so any help would be appreciated.

Best Regards

  • 1
    I think you want to call the program, generated from "`Code.c`", from awk. For that, see: http://stackoverflow.com/questions/14634349/calling-an-executable-program-using-awk – akluth Nov 22 '13 at 09:59
  • 1
    Please show till now what you have attempted. – Vishal R Nov 22 '13 at 09:59

1 Answers1

0
#!/bin/bash

while read line
do
    para=`echo $line | awk '{print $0}'`
    ./c_code $para
done < your_process_file
yanchong
  • 276
  • 1
  • 9
  • Thanks a lot for the reply. I have just done something similar. I wanted to double check if it was possible to achieve something like: awk'{system(c_code $0)}' (This does not work, but I read somewhere that system must be used to call an executable within awk) – user3017384 Nov 22 '13 at 10:20