Linux - Script to generate the output delimited by Comma/Pipe

Hi All,

I have a requirement where I need to go to a directory, list all the files that start with person* (for eg) & read the most recent file from the list of files.

While browsing through the forum, i found that the command ls -t will list the files. I am trying to generate the output of this command in pipedelimited/comma separated format.

ie like person.20120104|person.20120103|person.20120102

Can you pls help me with the Linux command for the same.

Thanks,
Freddie

Try this...

ls -t person* | tr '\n' '|'

--ahamed