| 1 |
# readfile.awk --- read an entire file at once |
| 2 |
# |
| 3 |
# Original idea by Denis Shirokov, [email protected], April 2013 |
| 4 |
# |
| 5 |
|
| 6 |
function readfile(file, tmp, save_rs) |
| 7 |
{ |
| 8 |
save_rs = RS |
| 9 |
RS = "^$" |
| 10 |
getline tmp < file |
| 11 |
close(file) |
| 12 |
RS = save_rs |
| 13 |
|
| 14 |
return tmp |
| 15 |
} |