一、检查是否已经安装perl,如果没有安装,进行安装
[qinshiqi@localhost Desktop]$ rpm -q perl
perl-5.10.1-127.el6.x86_64
如果没有安装 ,通过yum -install perl进行安装。
如何安装可参考:
http://qinshiqi.iteye.com/admin/blogs/2036014
[qinshiqi@localhost Desktop]$ perl -v二、创建一个*.pl文件 在CVS中,如果创建CVS用户 ,可以通过
[root@localhost CVSROOT]# htpasswd -c passwd yfeifei
New password:
Re-type new password:
Adding password for user yfeifei
d*_****
在/home/cvsroot/CVSROOT下运行htpasswd -c passwd yfeifei
(-c 会生成passwd文件,以后再创建用户就不需要 -c 参数了,可以使用 -n 参数直接指定用户名,但要在passwd文件中添加对应的用户名称加密密码以及:cvsroot)
(创建的feifei用户是以其所在群组为cvs的资格来可读可写可执行仓库中的文件)
修改passwd文件,在用户名后边加上cvsroot
*************************
[root@localhost CVSROOT]# htpasswd passwd qin
New password:
Re-type new password:
Adding password for user qin
[root@localhost CVSROOT]# cat passwd
yfeifei:7vV7AcR3pOORk:cvsroot
qishi:v8yvvdpJ71L7w:cvsroot
qin:9tTPnujUuKP82
[root@localhost CVSROOT]#
也可以通过以下perl语言脚本生成用户的密码,直接通过编辑生成passwd的用户列表;
1:创建可以登陆cvs服务的用户及密码,需要创建文件passwd
vi /home/cvsroot/CVSROOT/passwd
文件内容如下:
qin:xxxxx:cvsroot
cvsroot是系统用户,就是把cvs用户qin与系统用户cvsroot等效
2.xxxxxx为密码,由以下文件生成: vi /home/cvsroot/pwdgen.pl 文件内容:
#!/usr/bin/perl
srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift; my $crypttext = crypt ($plaintext, $salt);
print "${crypttext}\n";
3、生成pwdgen.pl脚本后可以像windows下一样运行 后边“test”是参数
$perl pwdgen.pl "test"
adMpHktIn0tR2
4、pwdgen.pl 脚本第一句
#!/usr/bin/perl
我们也可以直接给pwdgen.pl赋于可执行权限
chmod +x pwdgen.pl ./pwdgen.pl "some"
5.Hello World
vi hello.pl
print "this is my first perl script\n";
print "Hello,world";
*********************************************************************
perl脚本的知识请参考
http://www.cnblogs.com/huochangjun/archive/2012/08/31/Perl.htmlhttp://www.codesky.net/article/201007/131554.html
http://blog.sina.com.cn/s/blog_52510b1d01013a11.html
http://tech.it168.com/zt/perl/
http://jingyan.baidu.com/article/48b37f8d6c41eb1a646488bc.html