Shell script run in a case statement call to run a php file, also Perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script run in a case statement call to run a php file, also Perl
# 1  
Old 09-03-2018
Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed

From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file
eg

eg
a Shell script run in a case statement call to run a php file, also Perl or/and Python file???
Like

Code:
#!/usr/bin/bash
....
....
  case $INPUT_STRING in
	1)
		/usr/bin/php  /folder/subfolder/file.php
		break
		;;
	2)
		/usr/bin/perl  /folder/subfolder/file.pl
		break
		;;
	3)
		/usr/bin/python  /folder/subfolder/file.py
		break
		;;
	*)
		/usr/bin/ruby /folder/subfolder/file.... # not familiar
		;;
  esac
...
...
echo 
echo "That's all folks!"

# 2  
Old 09-03-2018
How can we help you? What's your question? What isn't working? How is it not working? What's the desired result that you are not getting? What's your intend?
This User Gave Thanks to Aia For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl program to run a Shell script issues...

Hi all, I have the following Perl script which is intended to run a Shell script and generate some logging for the purposes of tracking weather or not the script ran. I get an error, of course, since I don't know what I'm doing really. Here is the code: #!/opt/perl/bin/perl -w ... (14 Replies)
Discussion started by: zixzix01
14 Replies

2. Shell Programming and Scripting

php file unable to run shell script with arguments

echo $result=exec("./permit.sh".$_FILES); pls suggest some other method to run shell script in php .:wall::mad: (0 Replies)
Discussion started by: upvan111
0 Replies

3. Shell Programming and Scripting

Run shell script on different machine using perl script

I want to execute my shell script on remote machine using SSH in perl script. Please help me with syntax. (2 Replies)
Discussion started by: james1988
2 Replies

4. Shell Programming and Scripting

Dry run php script from shell

Is it possible to dry run a php script without actually executing it? Say I need to test the output of a php file to see if it matches a pattern. I need to run this on all php files on the server. But I fear if there are php files that make modifications, sends out mail etc, that should not happen.... (1 Reply)
Discussion started by: anilcliff
1 Replies

5. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

6. Shell Programming and Scripting

how to let the perl script to run for each file

Hi, I have more than 1 files in the directory. In bash, I can use cd /work for x in `ls` do : : done to run for each file in the directory. How about in perl script? filepath="ABC1" open(FILE, $filepath) or die "$filepath cannot be opened."; while(<FILE>) { : (1 Reply)
Discussion started by: natalie23
1 Replies

7. Shell Programming and Scripting

How to run perl code within a shell script...?

Hi, I have a sheel script that invokes a perl script...Now, instead havin the perl script as a separate file I'd like put the contents in the sheel script itself...But I am not sure how ro run that perl script contents.please help me Thanks (1 Reply)
Discussion started by: vijay_0209
1 Replies

8. Shell Programming and Scripting

Cannot run Shell script in PHP

Hello, I have written a code for uploading a file onto the server.The code is as follows: <? if ($_POST == "Upload File") { if( move_uploaded_file ($_FILES ,$target) ) { $tmpsrc = $_FILES ; echo... (2 Replies)
Discussion started by: michrods
2 Replies

9. Shell Programming and Scripting

Call shell script from php not run ?

Hi. I write a shell script for import data to oracle using sql loader. I set permission 755 or 777 for that script. I can run that script in the consol okay. When I call it from PHP using system command. I got return value 126 this value when don't have permission right ? I check step... (2 Replies)
Discussion started by: raccsdl
2 Replies
Login or Register to Ask a Question