Wednesday, October 19, 2011

How to create perforce user non-interactively

I was trying to create perforce user account using “p4 user -i” option. I wanted to bulk rename perforce login-ID's due to change in our organization policy.

Here is the command.
p4 user -i -f < tempfile.txt

Where typically a tempfile.txt will be of the form
----------------------------------------------------------------------------------------------
# cat user-template.txt
# A Perforce User Specification.
#
#  User:        The user's user name.
#  Type:        Either 'service' or 'standard'. Default: 'standard'. Read only.
#  Email:       The user's email address; for email review.
#  Update:      The date this specification was last modified.
#  Access:      The date this user was last active.  Read only.
#  FullName:    The user's real name.
#  JobView:     Selects jobs for inclusion during changelist creation.
#  Password:    If set, user must have matching $P4PASSWD on client.
#  Reviews:     Listing of depot files to be reviewed by user.

User:   guruss1

Email:  siddesh.gurusiddappa@emc.com

Update: 2011/10/18 05:04:00

Access: 2011/10/18 06:17:32

FullName:       siddesh

----------------------------------------------------------------------------------------------



In context of the perl script:
open (WRITE, ">", "tempfile.txt") or die "Can't open temp file for writing.\n";
print WRITE "User: $uName\n\n";
print WRITE "Email: $email\n\n";
print WRITE "Update: $date\n\n";
print WRITE "FullName: $fName $lName - $prefix\n\n";
close WRITE;
system( "p4 user -i -f < tempfile.txt");

2 comments:

Anonymous said...

http://www.acdating.net/index.php?do=/blog/77203/sim-free-mobile-phones-enjoy-the-freedom/
http://amuntai.16mb.com/index.php?p=blogs/viewstory/5705
http://www.bloglog.com/blog/xmyshang6/126479/the-pay-as-you-go-is-the-most-convenient-and-straightforward-modes-which-comes-without-any-hidden-or-the-monthly-fees
http://cinecloudfilms.com/index.php?do=/blog/92474/that-is-on-your-computer-by-protection-is-better-than-a-cure/
http://huangshumei.cocolog-nifty.com/blog/2013/01/these-days-ever.html
http://archive.remdublin.com/blog/xmyishang/2013/01/29/commented-kirk-parsons
http://www.benches2swings.com/vocab/catpath/there-was-urgent-need-%E3%83%86-%E3%82%A3-%E3%83%B3-%E3%83%90-%E3%83%BC-%E3%83%A9-%E3%83%B3-%E3%83%89-%E3%82%B9-%E3%83%8B-%E3%83%BC-%E3%82%AB-%E3%83%BC-replacement.html
http://www.bloglog.com/blog/fashion4/125905/it-039-ll-be-tough-and-it-039-ll-be-bright-yellow
http://prsites.biz/myblog-admin/it-has-built-the-new-internet-explorer7.html
http://www.clickprofesor.com/index.php?do=/blog/47656/when-you-use-a-spyware-remover/
http://thomsonshomebusiness.com/addons/socialnetwork2/index.php?p=blogs/viewstory/114
http://archive.remdublin.com/blog/huangshumei/2013/01/28/end-spyware
http://ludhianacity.net/blog/57433/choose-spyware-protection-prevent-spyware/
http://nen360.nenonline.org/blog/contract-deal
http://nen360.nenonline.org/blog/always-be-aware-where-you-search-your-spybot-virus-protetion

Free Antivirus Download said...

I don't think that it is create. free antivirus download