Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
How can i edit a field in a file (saving the changes in the file) using awk. I can find the line that i want to edit by looking up field 1, but on that line, i don't know how to edit field 2 and save change to file.

echo one two | awk ' { print $1 "$newval" } '
The command before the pipe-sign is the command you say will result in that first line of the file

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |