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
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
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
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
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
#
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
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
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
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
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
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
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
> 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
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
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]
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
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
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
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(
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
;
> $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
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
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
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, $
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
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
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
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:
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]
, 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
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
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
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
33 matches
Mail list logo