[p4] Scripting Login

Steven W. Orr steveo at syslang.net
Thu Jul 6 07:49:47 PDT 2006

On Thursday, Jul 6th 2006 at 07:54 -0400, quoth Vander Werf, Bruce:

=>I have several scripts (MSDOS batch files) I use to manage tasks on two
=>different Perforce servers. Where I get hung up is on the login. If I
=>haven't logged in to a server for 12 hours, a login is required and my
=>scripts fails. I haven't been able to figure out how to automate the
=>login process, at least not with batch files.  Anyone have any ideas on

An old girlfriend complained because her car squealed when it went around 
the corners too fast. The solution was to not corner too fast.

Here's an expect script that should solve your problem. Untested, but you 
get the idea:


#! /usr/bin/expect --
set password "FillThisIn"
eval spawn -noecho "p4 login"
expect "Enter password:"
send "$password\r"

Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

More information about the perforce-user mailing list