#!/usr/bin/bash # 当前目录 PWD=`pwd` FILE="$PWD/itaken.txt" i=0 # 读取每一行 while read LINE; do i=$((i+1)) # 如果为空,则忽略 if [[ "$i" == "" ]]; then continue fi echo "当前行内容: $i => $LINE" done < "$FILE"