Last active
September 19, 2018 18:27
-
-
Save pmihalcin/6004bf3973d2401a685675d35b013aa4 to your computer and use it in GitHub Desktop.
awk grymoire tutorial - http://www.grymoire.com/Unix/Awk.html#uh-0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/awk -f | |
| BEGIN { | |
| # Print the squares from 1 to 10 | |
| for (i=1; i <= 10; i++) { | |
| printf "The square of ", i, " is ", i*i; | |
| } | |
| # now end | |
| exit; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/awk -f | |
| BEGIN { | |
| print "File\tOwner" | |
| } | |
| { | |
| print $9, "\t", $3 | |
| } | |
| END { | |
| print " - DONE -" | |
| } | |
| // ls -l | awk -f file-owner.awk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment