AWK command not working

AlphaAlien

New Member
Joined
Jan 10, 2024
Messages
6
Reaction score
1
Credits
75
Hi guys so I am working out of quite an older book to learn linux and I am having a hell of a time to get the awk command to work. I dont know if maybe the syntax has some how changed over the years or what I am doing wrong. but here is this code I am putting in... it returns to a blank line under the command causing me to hit ctrl c to return a fresh line.

$ awk -F '{printf"%d %-12.12s %-10.10s\n", $1, $2, $3}' file1
 


I figured it out. my syntax was wrong. the book its hard to decipher what is a space and what isn't... so after some playing around with it I tried.

awk -F: '{printf "%d %-12.12s %-10.10s\n", $1, $2, $3}' file1

This ended up working..
 

Members online


Top