GithubHelp home page GithubHelp logo

Comments (1)

halfrost avatar halfrost commented on September 22, 2024

此处还是需要一个逗号,逗号是分隔符,如果没有逗号的话,统计出来的数字和前面是连在一起的:

$  netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a S[a]}'
FIN_WAIT_29
SYN_SENT1
CLOSE_WAIT347
TIME_WAIT64
ESTABLISHED146

加了逗号以后会和前面的说明符中间添加一个空格,会更加美观,看起来更加方便:

$  netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
FIN_WAIT_2 8
CLOSE_WAIT 346
TIME_WAIT 64
ESTABLISHED 151

不过你说出现语法错误的原因应该是逗号是中文状态下的,英文状态下的不会有语法错误。

from halfrost-field.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.