I am generating 2 output file from input wile using shell script. One successfully creating but 2nd file having only one row .
Suppose I have one input file(csv) with 3 rows.It generate one output file with some other information with all 3 rows But 2 nd out put file only generating with some other value with 1 row value only . Here Is my code :
#! /bin/bash
SAVEIFS=$IFS
IFS=","
if [ $# -gt 0 ]; then
INPUT_FILE="$1"
echo 'Brand,Width (mm),Height (mm),Depth (mm)' > mug.csv
echo 'Design Name, Type,Product ' > mugsku.csv
while read Brand designname width height types
do
echo "$brand.$width,$height,$depth" >> mug.csv
echo "$designname,$types,$ptype" > mugsku.csv
done < $INPUT_FILE
else
echo "No argument passed.Pass valid file name"
fi
Input file name I am passing as an argument