|
#!/usr/bin/perl -w
my $fsc = '/usr/local/bin/fixsrccont' ;
my $sshhost = 'my.unix.sshd.host' ;
my $view = 'my_view' ;
my $ct = '/opt/rational/clearcase/bin/cleartool' ;
sub ssh() {
my ( $account , $host ) = @_ ;
my $ssh = Net::SSH::Perl->new( $host );
$ssh ->login( $account );
return $ssh ;
}
sub dispatch {
my ( $owner , $arg ) = @_ ;
my $cmd = qq($fsc '$arg') ;
my ( $out , $err , $ret ) = ssh( $owner , $sshhost )->cmd(
qq($ct setview -exec "$cmd" $view) );
}
for ( @ARGV ) {
my ( $owner , $arg ) =~ /^(\w+?):(.*)$/;
dispatch( $owner , $arg );
}
|