Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: parse /etc/passwd and output it as csv in hundred servers

by garcimo (Novice)
on Apr 13, 2018 at 16:22 UTC ( [id://1212817]=note: print w/replies, xml ) Need Help??


in reply to Re: parse /etc/passwd and output it as csv in hundred servers
in thread parse /etc/passwd and output it as csv in hundred servers

THank you what is the meaning of the two lines you added:
$user =~ s/:.*$//mg; $user =~ s/\n/,/g;

Replies are listed 'Best First'.
Re^3: parse /etc/passwd and output it as csv in hundred servers
by hippo (Bishop) on Apr 13, 2018 at 17:22 UTC
Re^3: parse /etc/passwd and output it as csv in hundred servers
by Your Mother (Archbishop) on Apr 13, 2018 at 20:45 UTC

    Same thing hippo did but more idiomatic and less readable. :P

    say join ",", "hostname", $user =~ /^([^:]+)/gm;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1212817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found