Avatar of bemara57
bemara57

asked on 

Trying to run a Linux/Unix bash command from the web, possible or need CGI?

I need to create a bash file with a few commands. What I'm trying to do is a web interface to copy a directory into another directory and vice versa (two hyperlinks).

One link I want it to do:
cp /var/www/test /var/www/backup/test022207
cp /var/www/live /var/www/test

The other link I want:
cp /var/www/live /var/www/backup/live022207
cp /var/www/test /var/www/live

Not sure if it's possible to run a bash command from the web or I have to use Perl/CGI to do it. Any idea how I would accomplish this?
Scripting LanguagesLinux OS DevPerl

Avatar of undefined
Last Comment
ozo
ASKER CERTIFIED SOLUTION
Avatar of cwhicks
cwhicks

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Perl_Diver
Perl_Diver

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of ozo
ozo
Flag of United States of America image

CGI can talk to a bash script, or any other executable
you can also run scripts through telnet or ssh
Avatar of ozo
ozo
Flag of United States of America image

By 'CGI' do you mean the procol that HTTP uses to comunicate with applications, or do you mean the Perl module that contains fuctions for using this protocol?
SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Scripting Languages
Scripting Languages

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

30K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo