How to read input data files in sequence?

view story

http://superuser.com – I have to process multiple files using my shell script. The input & output data directories are different. My shell script is in another directory. Here is my program: #!/bin/bash clear DATAPATH='/home/datasets/data/' OUTPATH='/home/abc/data_new/' # Find the number of files in a directory nfiles=`find ./*.bin -type f |wc -l` echo $nfiles count=1; # Read the files sequentially for file in ./*.bin; do INFILE=$file; # Input file echo "Processing $INFILE ..." SUFFIX="1.txt" OUTFILE="${INFILE:0:18}$SUFFIX" # Output file # awk '{if(length($0) >= 79) print NR,", (HowTos)