떠들썩한 파일의 출력을 저장하고, 나는 각 폴더내가 폴더에 어떤 파일이
transaction1.csv
transaction2.csv
transaction3.csv
transaction4.csv
의 첫 번째 줄 필요하고 난 다음 코드를
#All folders that begin with the word transaction
folder='"transaction*"'
ls `echo $folder |sed s/"\""/\/g` >testFiles
# The number of lines of testFiles that is the number of transaction files
num=`cat testFiles | wc -l`
for i in `seq 1 $num`
do
#The first transaction file
b=`cat testFiles | head -1`
#The first line of the first transaction file
cat `echo $b` | sed -n 1p
#remove the first line of the testFiles
sed -i '1d' testFiles
done
이 코드가 작동을 문제는 내가 파일에 각 파일의 첫 줄을 저장할 필요가있다이다
그리고 난 라인 변경하는 경우 :
cat `echo $b` | sed -n 1p > salida
을
이없는 작품 = (
스크립트 최상단에'exec> salida'를 넣으면됩니다. –