Re: How to run a Shell script from within Perl





On Nov 23, 12:40 am, eldonlehm...@xxxxxxxxxxx wrote:
Hi there. I am new to this group and to Perl - but I would appreciate
some help.

I have a medical (diabetes) Website that is run for free - which I have
had on the Web for several years now. Over the years I have set up
some shell scripts to automate various backup and maintenance processes
at the Website. Everything was running fine until my ISP was ?taken
over and as a result went through a transition moving all their
customers' Websites to new servers. None of the nitty gritty of the
technical aspects of this transition were explained. However post
transition none of my Shell scripts - which previously worked fine -
would operate any longer.

I have just discovered from the ISP, months later, that the reason is
they no longer support Shell scripts on their servers. They recommend
that I run my Shell scripts from within Perl.

This may be fine - but I have absolutely no idea how to convert my
simple Shell scripts to run from within Perl.

No convertion would be necessary.

Is there a simple way to achieve this - or do I have to learn Perl and
re-write all the commands in Perl?

This very much depends on what you are trying to do. There is no simple
shell->Perl converter so if you want to convert you'll need to learn a
bit of Perl.

On the other hand if, as you first said, you only want to run your
shell scripts from within Perl then all you need to know is the one
Perl command exec().

I would be grateful for any help / guidance / suggestions that people
maybe able to offer.

You need to be clear about what it is you are trying to do.

If the ISP has prevented the httpd (or something) from calling shell
interpreter directly but has not actually prevented you using the shell
interpreter then this is one thing.

If the ISP has prevented you from calling the shell interpreter at all
this is quite another.

It seems likely that if they've got rid of the shell then they've
actually made some major platform changes so simply transliterating
things like backup and maintenance scripts would be unlikely to work as
chances are the commands you need for backup and maintenance will have
changed too.

.



Relevant Pages

  • Re: perl vs Unix grep
    ... variable indexCount on array and reintialized evry time. ... Perl is langauge to make things work at any cost. ... > grep but the shell scripts that use ... As far as I can tell from reading and research ...
    (comp.lang.perl)
  • Re: advocacy advice
    ... don't know Perl as well as you and so we will lose control and hence ... My group ran into problems and limitations of the shell scripts almost ... to query info from a database and construct commands from it, ... started converting them one by one to Perl. ...
    (comp.lang.perl.misc)
  • How to run a Shell script from within Perl
    ... I am new to this group and to Perl - but I would appreciate ... I have a medical Website that is run for free - which I have ... some shell scripts to automate various backup and maintenance processes ... technical aspects of this transition were explained. ...
    (perl.beginners)
  • Re: cross-platform shell scripts
    ... > Unix shell scripts and Windows batch files. ... Usually not necessary because Perl programs are inherently portable unless ... use either one on WIndows Unix doesn't like the backslash. ...
    (comp.lang.perl.misc)
  • Re: Re: [SLE] AGAINST PERL & PHP
    ... What upset us in not so much your opinion, ... Among the multitude is both Python and Perl. ... Therefore the programming language ... Shell scripts ...
    (SuSE)