ignorecase in AWK

后端 未结 4 807
轮回少年
轮回少年 2020-12-03 07:32

The following command is working as expected.

# some command | awk \'/(\\<^create\\>|\\<^alter\\>|\\<^drop\\>)/,/;/\' 
create table todel1         


        
4条回答
  •  -上瘾入骨i
    2020-12-03 07:52

    Add IGNORECASE = 1; to the beginning of your awk command like so:

    bash-3.2$ echo "Create" | awk '/^create/;'
    bash-3.2$ echo "Create" | awk 'IGNORECASE = 1;/^create/;'
    Create
    

提交回复
热议问题