Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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. #2
    Linux User
    Join Date
    Jul 2016
    Posts
    443
    took you longer to post this than it would have if you tried it. common sense would tell you that if you can call ONE program from a script you can call ANOTHER the same way.

  3. #3
    ok I will try it...

    There is any other scripting language works same in shell scripts like 4 i mention above Or Only these 4 are??? I am just curious?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User
    Join Date
    Jul 2016
    Posts
    443
    -->
    Quote Originally Posted by lse123 View Post
    ok I will try it...

    There is any other scripting language works same in shell scripts like 4 i mention above Or Only these 4 are??? I am just curious?
    TRY IT AND FIND OUT. how much babysitting do you need? again common sense will tell you that if you can use ONE program in a script you can use ANOTHER. but i guess the sense isnt as common as it needs to be.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •