当前位置:站长之家学习教程服务器类Linux使用教程 → 文章内容

生成cvs用户密码的shell

减小字体 增大字体 作者:佚名  来源:不详  发布时间:2005-12-8 14:44:37
[root@test11 cvsroot]# cat cvs.sh
#!/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 "$\n";