Dream Nebula | [home] [contact] [blog]

2023-08-05

Official Lain command

This perl one-liner changes the first “foo” in the second column to “bar”.

$ perl -lai -n -e '$F[1] =~ s/foo/bar/; print "@F"' <file>

If you want to modify a column in a file, Lain’s got you wired.