The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Transpose Rows
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 03-18-2009
iamwha1am iamwha1am is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 4
Thanks Johnson and Cherry for the responses.

The output from

sessList=$(ps -ef | awk -v sq="'" 'NR > 1 { printf sq "%s" sq ",", $2 }' )

looks like -
'0','1','3','4',

There is an additional comma in the end.

The Output from Cherry's command is exactly the one I was looking for.

However, can you please help me understand the syntax (am still grappling with sed and awk using google) so that I can change it if required in the future.