If you don't want to set up any P4 environment variables, you could use the global options and do something like this:
p4 -u <user> -P <password> -p <port> login
p4 -u <user> -P <password> -p <port> -c <workspace1> sync //path/to/sync/...
p4 -u <user> -P <password> -p <port> -c <workspace2> sync //other/path/...
p4 -u <user> -P <password> -p <port> -c <workspace3> sync //yet/another/path/...
If you set up the P4USER, P4PASSWD, and P4PORT P4 environment variables (see the p4 set command), then you could clean it up a little to look like this:
p4 login
p4 -c <workspace1> sync //path/to/sync/...
p4 -c <workspace2> sync //other/path/...
p4 -c <workspace3> sync //yet/another/path/...