On 5/29/19 4:45 PM, Asha Omanakuttan wrote:
> I need some contents to be written in csv format to a file.
>
> shell: ps -ef | grep java | awk '{print $1}'
> register: username
>
> shell: ps -ef | grep java | awk '{print $2}'
> register: id
>
> The output for username will be similar to :
> root
> admin
> test_admin
>
> The output for id will be similar to:
> 1232
> 4343
> 2233
>
> so I want this to be written to a csv file as
>
> root,1232
> admin,4343
> test_admin,2233
>
> Please suggest.
>
Hello Asha,
why not one task which already gives you the desired output:
ps -ef | grep java | awk '{print $1","$2}'
Regards
Racke
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f79dded4-69e0-e61f-44f0-3e958d3d5ea8%40linuxia.de.
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
