Perform Arithmetic Operations On Two Files

In this Blog , we will cover how to apply sum ,multiply or subtract operator on two files each having one field and same number of records. Consider the data in each file as below. Below is the Shell script which will multiply row by row from above two files and put the output in another file. arr1=()for line in cat linux.txt | tail -n+2doarr1+=(“$line”)donearr1_1=()for line in cat linux_1.txt | tail -n+2doarr1_1+=(“$line”)doneLenOfArr= ${#arr1[@]}touch newfile.txtecho “COL1” > newfile.txta=0while [ $a -le $((LenOfArr-1)) ]; do let ans=${arr1[a]}*${arr1_1[a]}; echo $ans >> newfile.txt; a=$((…