1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TCC & Auk

Discussion in 'T&T - Scripting' started by nchernoff, Jun 5, 2008.

  1. nchernoff

    nchernoff Administrator
    Staff Member

    May 16, 2008
    Likes Received:
    Migrated From Jp Software Wiki

    Awk is a pattern-action language. Perhaps the biggest hurdle to successfully using Awk with TCC is clashes in special characters. To avert excess head-scratching, put your awk scripts in a text file (typically with an extension of .awk), and use the -f {awk_script_filename} option of Awk.

    One limitation of awk is that patterns are case-sensitive. To work around that, one can use functions built-in to Awk.

    For example, suppose one wanted to print only lines containing the string "Whatever":

    /Whatever/  {print $0}
    To make the pattern case-INsensitive, one can use:

    {if (match(tolower($0),"whatever")) print $0}
    Also be aware that there are many variants of Awk available. Most have some unique features that will not work with other variants.

Share This Page