Re: Something screwy with split

2003-06-20 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: This works but does anyone have any ideas on the previous question? while(passwd_file ) { $line=$_; chomp($line); @list=split(/:/,$line); $account_key=$list[0]; $account=join :,@list;

Re: Something screwy with split

2003-06-14 Thread Rob Dixon
Royce Wells wrote: I am trying to split off the user name and the password record in one pass through however what I am getting is only the first record is being populated into my user array. Can someone tell me am I going about this the right way? Thanks, Royce my

Re: Something screwy with split

2003-06-14 Thread Harry Putnam
Rob Dixon [EMAIL PROTECTED] writes: open PWD, '/etc/passwd' or die $!; next line, anybody? while (PWD){ hehe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Something screwy with split

2003-06-13 Thread royce . wells
I am trying to split off the user name and the password record in one pass through however what I am getting is only the first record is being populated into my user array. Can someone tell me am I going about this the right way? Thanks, Royce my @user=(split(/:/,(@passwd=(split(/\n/,`cat

Something screwy with split

2003-06-13 Thread royce . wells
This works but does anyone have any ideas on the previous question? while(passwd_file ) { $line=$_; chomp($line); @list=split(/:/,$line); $account_key=$list[0]; $account=join :,@list; $record{$account_key}=$account; } I am trying

Re: Something screwy with split

2003-06-13 Thread James Edward Gray II
On Friday, June 13, 2003, at 12:01 PM, [EMAIL PROTECTED] wrote: I am trying to split off the user name and the password record in one pass through however what I am getting is only the first record is being populated into my user array. Can someone tell me am I going about this the right way?

Re: Something screwy with split

2003-06-13 Thread Casey West
It was Friday, June 13, 2003 when [EMAIL PROTECTED] took the soap box, saying: : Can someone tell me am I going about this the right way? : : my @user=(split(/:/,(@passwd=(split(/\n/,`cat /etc/passwd`)))[0])); : for($i=0;$i = $#passwd ; $i++) : { : print $user[$i]\n; : print $passwd[$i]\n; : }

Re: Something screwy with split

2003-06-13 Thread John W. Krahn
Royce Wells wrote: I am trying to split off the user name and the password record in one pass through however what I am getting is only the first record is being populated into my user array. Can someone tell me am I going about this the right way? You should probably use perl's builtin

Re: Something screwy with split

2003-06-13 Thread James Edward Gray II
On Friday, June 13, 2003, at 12:54 PM, [EMAIL PROTECTED] wrote: password file format user:passwd:uid:gid:gecos:homedir:shell I need to be able to change any of the fields within each user record. While having the hash key remain the same user across many files. I'm not sure I understand the

Re: Something screwy with split

2003-06-13 Thread Steve Grazzini
On Fri, Jun 13, 2003 at 12:28:47PM -0500, James Edward Gray II wrote: On Friday, June 13, 2003, at 12:01 PM, [EMAIL PROTECTED] wrote: my @user=(split(/:/,(@passwd=(split(/\n/,`cat /etc/passwd`)))[0])); I'm not 100% sure how your /etc/passwd is formatted, but if the name is before the