我的脚本应该遍历从 1 到 13 的每一列,但它忽略了 -f13。我将其更改为 -f14 只是为了看看它的作用,它从 -f13 打印出了我需要的内容。为什么会出现这种情况?
PMRNUM=`echo $ln | cut -d "," -f2
PMRMGR=`echo $ln | cut -d "," -f3`
MAJORINCIDENT=`echo $ln | cut -d "," -f1`
ASSIGNMENTGROUP=`echo $ln | cut -d "," -f4`
DUEDATE=`echo $ln | cut -d "," -f5`
PRIMARYAPP=`echo $ln | cut -d "," -f6`
IMPACTEDREGIONS=`echo $ln | cut -d "," -f7`
IMPACTEDCOUNTRIES=`echo $ln | cut -d "," -f8`
INTERNALEXTERNAL=`echo $ln | cut -d "," -f9`
BUSINESSIMPACTDESCRIPTION=`echo $ln | cut -d "," -f10`
PRBSTATE=`echo $ln | cut -d "," -f11`
RCL1=`echo $ln | cut -d "," -f12`
RCL2=`echo $ln | cut -d "," -f14`
答案1
发生这种情况是因为您的数据中第 13 列之前有一个额外的分隔符。