Because you used [tt][navy]FS[/navy][teal]=[/teal][green]"."[/green][/tt] as pattern. Reading and parsing the input line is performed before the regular pattern-action pairs are executed, so before your code sets the field separator.
Either set the field separator in the special [tt]BEGIN[/tt] rule :
Code:
ls | awk '[b]BEGIN[/b][teal]{[/teal][navy]FS[/navy][teal]=[/teal][i][green]"."[/green][/i][teal]}{[/teal] [b]print[/b] [navy]$2$1[/navy] [teal]}[/teal]'
or use the interpreter's [tt]-F[/tt] option to set the field separator :
Code:
ls | awk -F "." '[teal]{[/teal] [b]print[/b] [navy]$2$1[/navy] [teal]}[/teal]'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.