Why awk script does not work on Mac OS but works on Linux?

后端 未结 2 659
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 14:20

I have this awk script that I use to filter genes that are differentially expressed. I have a csv file that was created in R.

 #Command to get DE genes
awk -         


        
相关标签:
2条回答
  • 2020-12-05 14:56

    A same command name doesn't mean it is the same command. Most basic commands have a different implementation, AWK is an example, but almost all the GNU core utils has their equivalent in BSD license. You should be careful with GNU sed and BSD sed, it's a pitfall too.

    In reality Linux generally uses gawk or mawk:

    $ man awk
    mawk - pattern scanning and text processing language
    

    Mac OS uses generally nawk:

    $ man awk
    awk - pattern-directed scanning and processing language
    

    See this page for more informations about AWK implementations.

    0 讨论(0)
  • 2020-12-05 15:06

    I also had the same problem. Installing gawk on OSX 10.11.2 through brew solved my issue.

    ~$ brew install gawk
    ~$ gawk --version | head -n 1
    GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.4-p1, GNU MP 6.1.1)
    ~$
    
    0 讨论(0)
提交回复
热议问题