Chuck,
If I assume your top level script is a bash script, then I think you
need to read up on "here documents".
http://en.wikipedia.org/wiki/Here_document
I believe you can implement your python and perl as here docs, once
you understand how they work.
Same for any interpreted language that you want to call from bash.
Greg
On Mon, Aug 10, 2009 at 8:27 AM, Chuck Payne
Sorry if this question seem a bit silly, but I am still very much a newbie when it come some to scripting.
I want to write a shell script that does some scp of files, but I like to use both bash and perl. Could I do some thing this, how would I got about mixing shell, python, perl and other things with in a script.
#!/bin/bash
workdir=/tmp file="`hostname`.`date +%m%d%Y`.tgz"
# Functions
scpjvm () {
#!/usr/bin/perl -w
use Net::SFTP; use strict;
my $host = "mars.myhost.com"; my %args = ( user => 'toor, password => '1234567', debug => 'true' );
my $sftp = Net::SFTP->new($host, %args); $sftp->get("/tmp/'jvm.`hostname`.`date +%m%d%Y`.tgz'", "/home/ia/'jvm.`hostname`.`date +%m%d%Y`.tgz'");
}
# The work
cd $workdir
tar czvfpP $file /etc/httpd /opt/jboss/jboss/bin/ /opt/jboss/jboss/server /usr/local/bin --exclude *log* --exclude *nohup*
scpjvm
rm $file
-- ---------------------------------------- Old utilities do not die they just slowly fade away! ----------------------------------------- OpenSUSE -- http://en.opensuse.org/User:Terrorpup OpenSuSE Ambassador OpenSuSE Member Skype -- terrorpup twitter -- terrorpup -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- Greg Freemyer Head of EDD Tape Extraction and Processing team Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer Preservation and Forensic processing of Exchange Repositories White Paper - http://www.norcrossgroup.com/forms/whitepapers/tng_whitepaper_fpe.html The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org