Re: Increment UID Field

2011-07-20 Thread Rob Coops
On Wed, Jul 20, 2011 at 9:53 PM, Shlomi Fish wrote: > Hi Overkill, > > On Wed, 20 Jul 2011 13:24:06 -0400 > Overkill wrote: > > > Greetings, > > > > I'm trying to increment the UID field of the unix password file from an > > csv file. I've tried

Re: Increment UID Field

2011-07-20 Thread Shlomi Fish
Hi Overkill, On Wed, 20 Jul 2011 13:24:06 -0400 Overkill wrote: > Greetings, > > I'm trying to increment the UID field of the unix password file from an > csv file. I've tried to insert C style increment and it keeps bomping > out. What would be the logic to increm

Re: Increment UID Field

2011-07-20 Thread Overkill
Rob, great ideas and worked like a charm. Thanks again, Overkill. On 07/20/2011 01:42 PM, Rob Coops wrote: On Wed, Jul 20, 2011 at 7:24 PM, Overkill wrote: Greetings, I'm trying to increment the UID field of the unix password file from an csv file. I've tried to insert C style

Re: Increment UID Field

2011-07-20 Thread Rob Coops
On Wed, Jul 20, 2011 at 7:24 PM, Overkill wrote: > Greetings, > > I'm trying to increment the UID field of the unix password file from an csv > file. I've tried to insert C style increment and it keeps bomping out. > What would be the logic to increment the 5009 to

Increment UID Field

2011-07-20 Thread Overkill
Greetings, I'm trying to increment the UID field of the unix password file from an csv file. I've tried to insert C style increment and it keeps bomping out. What would be the logic to increment the 5009 to increment by one? Thanks for any help. -Overkill #!/usr/bin/perl #

Re: UID question

2005-08-25 Thread Tony Frasketi
Thanks very much John. John W. Krahn wrote: Tony Frasketi wrote: Is there an ASCII equivalent to the numeric value UID returned by stat($filename)[4] and if so is there a function to aquire the ASCII value... Also is the UID related to the owner of the file as shown in the directory

Re: UID question

2005-08-25 Thread John W. Krahn
Tony Frasketi wrote: > Is there an ASCII equivalent to the numeric value UID returned by > stat($filename)[4] and if so is there a function to aquire the ASCII > value... Also is the UID related to the owner of the file as shown in > the directory display ls -al in Unix? > &g

UID question

2005-08-25 Thread Tony Frasketi
Is there an ASCII equivalent to the numeric value UID returned by stat($filename)[4] and if so is there a function to aquire the ASCII value... Also is the UID related to the owner of the file as shown in the directory display ls -al in Unix? If UID and file ownership is not, however related

Re: How to set uid ?

2005-08-03 Thread John W. Krahn
Prasad J Pandit wrote: > Hello friends ! Hello, > Does any one know how to set user-id in perl script? I > mean counter-part of setuid() in perl ?? You mean that you don't want to use POSIX::setuid()? You might want to lookup the $< and $> variables in: perldoc perlvar John -- use Perl; p

How to set uid ?

2005-08-03 Thread Prasad J Pandit
Hello friends ! Does any one know how to set user-id in perl script? I mean counter-part of setuid() in perl ?? Regards -Prasad PS: Please don't send me html/attachment/Fwd mails Start your day with Yahoo! - make it yo

Re: Changing UID/GID

2003-06-11 Thread Shlomi Fish
On Wed, 11 Jun 2003, tsg wrote: > Hi everybody! > > Could You pease point me where I can get answers following questions: > 1. How can I now the UID of the user who started perl-script? Try $< (or $UID or $REAL_USER_ID with use English) for the real user id. Try

Changing UID/GID

2003-06-11 Thread tsg
Hi everybody! Could You pease point me where I can get answers following questions: 1. How can I now the UID of the user who started perl-script? 2. How can I change UID/GID the script is running under. I need to start script with root privilegies and when drop them to apache.apache. Thanks in

RE: Is there a simple way to do uid -> username and usename -> ui d mapping?

2003-02-20 Thread Kipp, James
> Sent: Thursday, February 20, 2003 2:48 PM > To: [EMAIL PROTECTED] > Subject: Is there a simple way to do uid -> username and > usename -> uid > mapping? > > > I've got a file for which I use 'stat' to acquire its > information, but > stat giv

Re: Is there a simple way to do uid -> username and usename -> uid mapping?

2003-02-20 Thread John Baker
perldoc -f getpwuid $uid = getpwnam($name); $name = getpwuid($num); $name = getpwent(); $gid = getgrnam($name); $name = getgrgid($num); jab On Thu, 20 Feb 2003, Ben Siders wrote: > Date: Thu, 20 Feb 2003 13:48:01 -0600 > From: Ben Siders <[EMAIL PROTECT

Is there a simple way to do uid -> username and usename -> uid mapping?

2003-02-20 Thread Ben Siders
I've got a file for which I use 'stat' to acquire its information, but stat gives you numeric uid and gids. I need to get to the actual username and groupname. How can this be done? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Skipping the UID above 60000

2002-09-02 Thread Ramprasad A Padmanabhan
But Why do you want the next available uid, If it was for adding a new user I would suggest You use /sbin/useradd command rather than attempting to write into passwd directly. I did this that mistake for one of my projects and find myselyf in a soup many a times Ram Anidil Rajendran wrote

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
getpwuid() search the password database for the given login name or user uid, respectively, always returning the first one encountered. The getpwent() function sequentially reads the password database and is intended for programs that wish to process the complete list

Re: Skipping the UID above 60000

2002-09-01 Thread John W. Krahn
Drieux wrote: > > On Sunday, September 1, 2002, at 01:53 , John W. Krahn wrote: > [..] > > The only UID that should be above 6 is the user "nobody" whose UID > > is 65534. > > you know and I know - what would be 'reasonable' > and what h

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
On Sunday, September 1, 2002, at 01:53 , John W. Krahn wrote: [..] > The only UID that should be above 6 is the user "nobody" whose UID > is 65534. you know and I know - what would be 'reasonable' and what happens [..] > > while ( my(

Re: Skipping the UID above 60000

2002-09-01 Thread John W. Krahn
Anidil Rajendran wrote: > > Hi Perl Gurus, Hello, > This is a newbie question ofcourse. Since it is not working for me I am asking here. > I am trying to skip UID above 6. The only UID that should be above 6 is the user "nobody" whose UID is 65534. > $passwd

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
; > $highestuid = ($highestuid < $fields[2]) ? $fields[2] : $highestuid; > } > close(PW); > print "The next available UID is " . ++$highestuid . "\n"; it looks like you have somewhat mutually conflicting goals. you might want to declare your $highestuid outside of th

Skipping the UID above 60000

2002-09-01 Thread ANIDIL RAJENDRAN
Hi Perl Gurus, This is a newbie question ofcourse. Since it is not working for me I am asking here. I am trying to skip UID above 6. $passwd = "/etc/passwd"; $skip = 6; open(PW,$passwd) or die "Can't open $passwd:$!\n"; while (){ @fields = split(/:/); n

Re: modify UID in /etc/passwd file ?

2002-06-12 Thread David T-G
fe % real hard you see. And, of course, if you're changing existing users you will have to change the ownership of all files on the system, so you'll want to either do that as part of your change (time-consuming) or store a mapping of old UID with either new UID or login (perhaps shoeh

Re: modify UID in /etc/passwd file ?

2002-06-12 Thread David vd Geer Inhuur tbv IPlib
HI Frank, You can use this one : #!/usr/local/bin/perl my $file = "/etc/passwd"; my $temppwfile = "/etc/tmppasswd"; $teller = 5000; open(PW, "< $file"); open(NEWPW, ">$temppwfile"); while () { ($user, $pw, $uid, $grpid, $descr, $home, $

modify UID in /etc/passwd file ?

2002-06-12 Thread Frank Bonnet
Hi I need a script that modify the UID field in a /etc/passwd file for UNIX the purpose is to change the existing UID field from a start number (Eg 5000 ) for the first line then do UID + 1 for the next line etc etc until EOF Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: what uid owns process 0?

2002-05-10 Thread Anders Holm
upport Engineer -- Tel USA/Canada: 1 800 353 8437 Tel Worldwide: +1 801 736 0806 E-mail: [EMAIL PROTECTED] Internet: http://support.cp.net -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: 09 May 2002 22:26 To: [EMAIL PROTECTED] Subject

RE: what uid owns process 0?

2002-05-09 Thread LoBue, Mark
on HP-UX: ced1p:[8SICU] CHARTING> ps -p0 PID TTY TIME COMMAND 0 ?23:54 swapper -Mark -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 2:26 PM To: [EMAIL PROTECTED] Subject: what uid owns process 0? volks, I decided

what uid owns process 0?

2002-05-09 Thread drieux
volks, I decided to help john to start by writing a ps Tree to process the data into the classic tree structures we all like: http://www.wetware.com/drieux/CS/lang/Perl/Beginners/Sys/psTree.txt and I keep getting the output pid: 0 is owned by UNK and has children: 1 2 but if I do:

UID + GID's

2001-12-04 Thread Christo Rademeyer
Hi how can I write a script to add one on my last UID + GID? Thanks. Christo -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: change uid in perl ??

2001-10-31 Thread Lirot, Gregory
, etc...\"); Inside the quotes, you can stack commands up like: system("su - fred -c \"cmd 1; cmd 2; ... cmd n\"); Hope this helps. .. Greg -Original Message- From: Steve Wright [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 7:06 AM To: 'Beginners@Pe

change uid in perl ??

2001-10-31 Thread Steve Wright
I'm quite new to perl & hoping someone here can help me. I need my perl program to change to a different user and I'm not sure how to do it. What I want; run program a run program b change to user "fred" move files move more files change back to root run another program I have perl running the

Re: uid

2001-07-02 Thread Tim Musson
e both (Apache) UNIX based and have windows2000 installed on RA> them. Not sure I followed that. If the servers are UNIX based, how do they have Windows2000 installed? UNIX and Windows2000 are *very* different Operating systems! RA> The old one had a UID. That would indicate that at least

uid

2001-07-02 Thread RL Autry
Hello everyone: We just joined the list. We copied some scripts from our old server onto our new one. They are both (Apache) UNIX based and have windows2000 installed on them. The old one had a UID. We noticed that it was a combination of our username and password for the old server (so it