shell中awk分割字符:
F后面为分割符号
name=`echo "my name is Eric"|awk -F ' ' '{print $4}'`
Example:
#!/bin/bash
total=0
for i in `ls *.json`
do
num=`wc -l $i | awk -F ' ' '{print $1}'`
let total=$total+$num
echo $total
done;
shell中awk分割字符:
F后面为分割符号
name=`echo "my name is Eric"|awk -F ' ' '{print $4}'`
Example:
#!/bin/bash
total=0
for i in `ls *.json`
do
num=`wc -l $i | awk -F ' ' '{print $1}'`
let total=$total+$num
echo $total
done;