[Za-pm] Using perl to call a bash script

Steve Cox -dig steve at dig.co.za
Mon May 12 14:19:22 CDT 2003


Two fold message,

Howdie all, just testing is this works,

Secondly, I use some php, but I am interested, can you call a bash script from 
perl (probably). If so, as a user/or from a webpage can I also call raw bash 
comands like if the perl script is in the cgi-bin how could I include a raw 
bash command (as root if possible) to pull the following to a file:

steve at steve]# grep pppd /var/log/syslog > anewfile

I cant get a root cronjob working and from a user I cant pull records from the 
/var/log/syslog

A simple example of typical output at www.dig.co.za go to "my home pc" then 
"statistics" this at the moment is run manualy every so often. My script 
works when I run it in bash manually, just as root its a no go.

Anyways, nice to have a perl list, and I know for fact it will help me plenty. 
I dig php but prefer perl for some stuff, so an integration of both is cool.

For what its worth, I run a small lan at home off a ADSl conection, 4 Mandrake 
9.1 machines, one is a gateway samba server (P1 100mhz 32meg ram) and one 
other P4 1.7 dual boots off seperate hdd to win98 for the time being. Others 
plain Mandrake.

Oh b4 we have any flamewars - the best distro:
LINUX !

Regards
Steve Cox



More information about the Za-pm mailing list