for i in `< file.txt` ; do echo -n $i; done; echo ""
给出输出
ApplChk1,ApplChk2,v_baseLoanAmountTI,v_plannedClosingDateField,downPaymentTI,
要将输出发送到文件:
{ for i in `< file.txt` ; do echo -n $i ; done; echo; } > out.csv
当我运行它时,会发生以下情况:
[jenny@jennys:tmp]$ more file.txt
ApplChk1,
ApplChk2,
v_baseLoanAmountTI,
v_plannedClosingDateField,
downPaymentTI,
[jenny@jenny:tmp]$ { for i in `< file.txt` ; do echo -n $i ; done; echo; } > out.csv
[jenny@jenny:tmp]$ more out.csv
ApplChk1,ApplChk2,v_baseLoanAmountTI,v_plannedClosingDateField,downPaymentTI,