From the course: Bash Patterns and Regular Expressions

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Pattern matching differences in AWK

Pattern matching differences in AWK - Bash Tutorial

From the course: Bash Patterns and Regular Expressions

Start my 1-month free trial

Pattern matching differences in AWK

- [Instructor] Because Awk isn't just a tool that searches through text, it is different than the others we've looked at. As such there are some differences in how it handles patterns. In GNU EREs, we have the bask slash special expressions which we covered in the "Matching Characters and Words" video in this course. See that video for a refresher if necessary. One the back slash special expressions we talked about was the \b which matches the empty string at the edge of a word. The \b character was already being used in Awk, so to do the same thing, they changed it to \y. In POSIX Regexes we anchor to the beginning or end of text with the caret and dollar sign special characters. They still work in Awk but there's also two more. Back slash back tick matches the empty string at the beginning of a buffer. Back slash single quote matches the empty string at the end of a buffer. If you're using Awk in a Bash script, you may need to get shell variables inside of Awk so it can use the…

Contents