[Solved] How to read a file line by line and making a new file for each line having same filename as last word of each line? [closed]


#!/bin/bash

cat datafile| \
while read line
do
    lastword=${line##*,}
    echo $lastword
    echo $line > $lastword
done

3

solved How to read a file line by line and making a new file for each line having same filename as last word of each line? [closed]