I have an issue with using AWK to simply remove a field from a stream, illustrated below:
1 int blah (void)
2 {
3 if (foo) {
4 printf ("blah\n");
5 }
6 return 0;
7 }
I use the following code to remove the first field:
$ awk '{ $1=""; print }' example.out
int blah (void)
{
if (foo) {
printf ("blah\n");
}
return 0;
}
Why is this the case? Is this because AWK removes all whitespace - can this be prevented?
Kind regards in advance