You should look into using the rsync cpan module.<br><br><a href="http://search.cpan.org/~leakin/File-Rsync-0.42/Rsync.pm">http://search.cpan.org/~leakin/File-Rsync-0.42/Rsync.pm</a><br><br>Not only can you keep it all in perl-land, but you can use your already generated script as source material for your new perl script that &quot;does it all&quot;.<br>
<br>A few ssh keys and some creative rsyncing, and you can manage just about anything.  Also, if you want to run interactively, you can use Expect.pm and do it in an automated fashion:<br><br><a href="http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod">http://search.cpan.org/~rgiersig/Expect-1.21/Expect.pod</a><br>
<br><br>Hope that helps!<br><br clear="all">---<br>Jerald M. Sheets jr.<br>
<br><br><div class="gmail_quote">On Mon, Aug 10, 2009 at 11:34 AM, Tim Watts <span dir="ltr">&lt;<a href="mailto:timtw@earthlink.net">timtw@earthlink.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Another way to mix bash &amp; perl uses perl&#39;s -x option and __END__.<br>
<br>
The nice thing here is you don&#39;t have to worry about quoting so much. See man<br>
perlrun for more details.<br>
<br>
#!/bin/bash<br>
<br>
echo &quot;This is from bash&quot;<br>
perl -x $0 &quot;$@&quot;<br>
echo &quot;back to bash&quot;<br>
exit 0;<br>
<br>
#!perl<br>
use English;<br>
use strict;<br>
<br>
print &quot;This is from perl\n&quot;;<br>
<br>
my $a;<br>
foreach $a (@ARGV) {<br>
  print &quot;arg: $a\n&quot;;<br>
}<br>
<br>
__END__<br>
<br>
<br>
Be sure to exit in the bash portion before you hit #!perl or bash will start<br>
complaining. __END__ is not strictly necessary if nothing follows it in the<br>
file.<br>
<div><div></div><div class="h5"><br>
<br>
On Monday 10 August 2009 8:28:18 am Chuck Payne wrote:<br>
&gt; Sorry if this question seem a bit silly, but I am still very much a<br>
&gt; newbie when it come some to scripting.<br>
&gt;<br>
&gt; I want to write a shell script that does some scp of files, but I like<br>
&gt; to use both bash and perl. Could I do some thing this,  how would I<br>
&gt; got about mixing shell, python, perl and other things with in a<br>
&gt; script.<br>
&gt;<br>
&gt; #!/bin/bash<br>
&gt;<br>
&gt; workdir=/tmp<br>
&gt; file=&quot;`hostname`.`date +%m%d%Y`.tgz&quot;<br>
&gt;<br>
&gt; # Functions<br>
&gt;<br>
&gt; scpjvm () {<br>
&gt;<br>
&gt; #!/usr/bin/perl -w<br>
&gt;<br>
&gt; use Net::SFTP;<br>
&gt; use strict;<br>
&gt;<br>
&gt; my $host = &quot;<a href="http://mars.myhost.com" target="_blank">mars.myhost.com</a>&quot;;<br>
&gt; my %args = (<br>
&gt;     user =&gt; &#39;toor,<br>
&gt;     password =&gt; &#39;1234567&#39;,<br>
&gt;     debug =&gt; &#39;true&#39;<br>
&gt; );<br>
&gt;<br>
&gt; my $sftp = Net::SFTP-&gt;new($host, %args);<br>
&gt; $sftp-&gt;get(&quot;/tmp/&#39;jvm.`hostname`.`date +%m%d%Y`.tgz&#39;&quot;,<br>
&gt; &quot;/home/ia/&#39;jvm.`hostname`.`date +%m%d%Y`.tgz&#39;&quot;);<br>
&gt;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; # The work<br>
&gt;<br>
&gt; cd $workdir<br>
&gt;<br>
&gt; tar czvfpP $file  /etc/httpd /opt/jboss/jboss/bin/<br>
&gt; /opt/jboss/jboss/server /usr/local/bin --exclude *log* --exclude<br>
&gt; *nohup*<br>
&gt;<br>
&gt; scpjvm<br>
&gt;<br>
&gt; rm  $file<br>
<br>
--<br>
</div></div>It is the final proof of God&#39;s omnipotence that he need not exist in order to<br>
save us.<br>
 -- Peter De Vries<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
</div></div></blockquote></div><br>