1

naming files in awk

view story
linux-howto

http://www.unix.com – I have a whole directory and I need each lines of each file to be separated to a new file but I am facing problem naming them :( some of the files even might be empty the output files should be names original file name + the number of the line or any incremental number Code: FILES="data/*" for X in $FILES do         name=$(basename $X)         awk '{ print $0 }' $X > “NR-${name}” done can you please help me what needs to go instead of NR? (HowTos)