Unix/Linux Go Back    

Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

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

Shell Programming and Scripting

Thread Tools Search this Thread Display Modes
Old Unix and Linux 01-22-2012
dsfreddie dsfreddie is offline
Registered User
Join Date: Dec 2011
Last Activity: 4 March 2013, 5:31 AM EST
Posts: 69
Thanks: 8
Thanked 0 Times in 0 Posts
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.

Sponsored Links
Old Unix and Linux 01-22-2012
ahamed101's Unix or Linux Image
ahamed101 ahamed101 is offline Forum Advisor  
root is god!!!
Join Date: Sep 2008
Last Activity: 19 October 2016, 5:02 AM EDT
Location: San Jose, CA
Posts: 1,910
Thanks: 54
Thanked 488 Times in 481 Posts
Try this...
ls -t person* | tr '\n' '|'

Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Remote command output to file comma delimited markdjones82 Shell Programming and Scripting 0 06-10-2010 09:57 AM
Converting comma separated to pipe delimited file anijan Shell Programming and Scripting 15 05-17-2010 06:38 AM
Need help with shell script for chekking a column in txt file - pipe delimited ravi0435 UNIX for Dummies Questions & Answers 12 01-02-2009 03:31 PM
How to generate a pipe ( | ) delimited file? anushree.a Shell Programming and Scripting 5 10-15-2008 02:35 AM
Comma Delimited Output w/ egrep indianadoug Shell Programming and Scripting 2 03-10-2005 03:20 PM

All times are GMT -4. The time now is 12:33 AM.