linux command wc

Linux command wc

Purpose

       Learning how to statistics line numbers in file

 

Eevironment

       Ubuntu 16.04 terminal

 

Procdeure

      

$ cat test.sh 
#!/bin/bash

echo "shell args option"
echo "script name : $0"
echo "first args : $1"
echo "first args : $2"
echo "first args : $3"

echo "------- $# demonstration"
echo "args number: $#"


echo "------- $$ demonstration"
echo "shell pid: $$"

echo "------- $* demonstration"
for i in "$*";do
echo $i
done

echo "------- $@ demonstration"
for i in "$@";do
echo $i
done

echo "------- $- demonstration"
echo $-

$ cat test.sh | wc -l
27

it can be use for  statistics  line numbers

原文地址:https://www.cnblogs.com/lianghong881018/p/10314082.html