Script to list the file names in a directory

view story

http://www.unix.com – Hi all, I need a shell script to write into a .txt file the no of files in a directory with extension and separated by comma in between. For eg, a directory contains files like a.csv b.csv c.csv d.csv Then the output in the output.txt file should be like a.csv,b.csv,c.csv,d.csv Shell used : bash directory should be passed as parameter. Please provide comments, if possible. Thanks in advance. Regards, Unix User (HowTos)