5 deleted 29 characters in body
source | link

I need to do this so when I open the .csv in excel each column has its own tab.

My text looks like this:

smmsp              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT                            n    Account expires : never
samba              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT                               n    Account expires : never
puppet             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT                              n    Account expires : never

I need it like that:

smmsp,              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT,                            n,    Account expires : never,
samba,              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT,                               n,    Account expires : never,
puppet,             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT,                              n,    Account expires : never,

I tried to pipe the outpu to awk 'gsub(" ", ",", $1)' FS=, OFS=, but it replace every single space with a comma, any help is much appreciated

I need to do this so when I open the .csv in excel each column has its own tab.

My text looks like this:

smmsp              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT                            n    Account expires : never
samba              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT                               n    Account expires : never
puppet             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT                              n    Account expires : never

I need it like that:

smmsp,              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT,                            n,    Account expires : never,
samba,              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT,                               n,    Account expires : never,
puppet,             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT,                              n,    Account expires : never,

I tried to pipe the outpu to awk 'gsub(" ", ",", $1)' FS=, OFS=, but it replace every single space with a comma, any help is much appreciated

I need to do this so when I open the .csv in excel each column has its own tab.

My text looks like this:

smmsp              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT                            n    Account expires : never
samba              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT                               n    Account expires : never
puppet             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT                              n    Account expires : never

I need it like that:

smmsp,              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT,                            n,    Account expires : never,
samba,              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT,                               n,    Account expires : never,
puppet,             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT,                              n,    Account expires : never,

I tried to pipe the outpu to awk 'gsub(" ", ",", $1)' FS=, OFS=, but it replace every single space with a comma

4 edited tags
| link
3 added 512 characters in body; edited tags; edited title
source | link

How to add column forcomma after each user account expiration status, another column saying yes or no for ssh login and lastlogin?

The output ofI need to do this command gives me:so when I open the .csv in excel each column has its own tab.

My text looks like this:

getentsmmsp passwd | cut           Purpose -d' Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT                            n    Account expires :' never
samba              Purpose -f1,5,7 |Service grepaccount for Samba; Owner -i purposesysadmin; |SERVICE columnACCOUNT                               n    Account expires : never
puppet             Purpose -s" Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT                              n    Account expires :" –tnever

user1 Purpose - Account used by non live systems to gain some info; Owner - sysadmin; SERVICE ACCOUNT /bin/bash

user2 Purpose - Account used by non live systems to gain some info; Owner - sysadmin; SERVICE ACCOUNT /sbin/nologin

I need to write a scriptit like that outputs a .csv file from /etc/passwd with the column of service accounts, column of the comment field, column y/n ssh login, column account expiration status and last login.:

smmsp,              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT,                            n,    Account expires : never,
samba,              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT,                               n,    Account expires : never,
puppet,             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT,                              n,    Account expires : never,

I know withtried to pipe the outpu to chageawk –l'gsub(" ", ",", $1)' FS=, OFS=, for account expiration status and last for last login but I don't know how to go from here.it replace every single space with a comma, any help is much appreciated

How to add column for each user account expiration status, another column saying yes or no for ssh login and lastlogin

The output of this command gives me:

getent passwd | cut -d':' -f1,5,7 | grep -i purpose | column -s":" –t

user1 Purpose - Account used by non live systems to gain some info; Owner - sysadmin; SERVICE ACCOUNT /bin/bash

user2 Purpose - Account used by non live systems to gain some info; Owner - sysadmin; SERVICE ACCOUNT /sbin/nologin

I need to write a script that outputs a .csv file from /etc/passwd with the column of service accounts, column of the comment field, column y/n ssh login, column account expiration status and last login.

I know with chage –l for account expiration status and last for last login but I don't know how to go from here.

How to add comma after each column?

I need to do this so when I open the .csv in excel each column has its own tab.

My text looks like this:

smmsp              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT                            n    Account expires : never
samba              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT                               n    Account expires : never
puppet             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT                              n    Account expires : never

I need it like that:

smmsp,              Purpose - Service account for Sendmail; Owner - sysadmin; SERVICE ACCOUNT,                            n,    Account expires : never,
samba,              Purpose - Service account for Samba; Owner - sysadmin; SERVICE ACCOUNT,                               n,    Account expires : never,
puppet,             Purpose - Service account for Puppet; Owner - sysadmin; SERVICE ACCOUNT,                              n,    Account expires : never,

I tried to pipe the outpu to awk 'gsub(" ", ",", $1)' FS=, OFS=, but it replace every single space with a comma, any help is much appreciated

2 deleted 26 characters in body; edited tags
source | link
1
source | link