How do I transpose a column of results to a row

Hi,

Can anyone advise me what command I could use to display the results of the following command as a row.

Thanks

Gareth

lslpp -l | grep tsm | tr '\n' ' '

If you prefer a newline character after the line:

lslpp -l|awk '/tsm/{ORS=" "}{print}END{print "\n"}' file

Thanks for this code. It's doing exactly what I asked but unfortunately my plan to use the resulting output as input to another command isn't working.
I was trying to use this as input to the command below, however it's only processing the first item in the list.

sm_inst installp_cmd -u -f `lslpp -l|grep tsm| tr '\n' ' '`

If I was to type the filesets in manually the command would be as shown below but placing `lslpp -l|grep tsm| tr '\n' ' '` within the quotes doesn't work at all.

sm_inst installp_cmd -u -f'fileset-1 fileset-2'

I did try the other suggestion but just got an error

lslpp -l|awk '/tsm/{ORS=" "}{print}END{print "\n"}' file
awk: 0602-533 Cannot find or open file file.
 The source line number is 1.

Can anyone suggest a more sensible and succesful way of implementing this?

thanks

Gareth

What about putting the filelist into a variable and let work the shell expansion?

LIST=`lslpp -l | grep tsm | tr '\n' ' '`
sm_inst installp_cmd -u -f "$LIST"

You have to use double quotes instead of single ones. Maybe you can also get rid of the tr command.

Oops, you don't read from a file, you can remove that:

 lslpp -l|awk '/tsm/{ORS=" "}{print}END{print "\n"}'

Regards

All working now.

Thanks to both you guys for your assitance and apologies to franklin52 for being a bit stupid when trying to run your command.