Interacting with the linux system

2

Is there any function or way of getting javascript / angularjs to communicate with linux?

For example:

<!doctype html>
<html ng-app="myApp">
    <head>
        <link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.css">
    </head>
    <body>
        <h2>{{kapp}}</h2>
        <div class="busca" id="div1">
            <input class="form-control"type="text" placeholder="Digite o nome completo" ng-model="search"/>
            <button type="button" class="btn btn-lg btn-info" id="bot" ng-click="buscar(search)" onclick="fecha();">
                Search  
                <i class="glyphicon glyphicon-search"></i>
            </button>
        </div>
    </body>
    <script>
        angular.module('myApp', []);
        angular.module('myApp', []).controller("customersCtrl",function ($scope, $http)
        {   
            $scope.kapp = "Buscado";
            $scope.buscar = function (name)
            {
                $scope.search = name;
            }
    </script>
</html>

Well, would you have any way of when 'name' gets a name and this name is passed to a variable from a Shellscript, python or C file?

    
asked by anonymous 26.05.2015 / 19:24

1 answer

1

It works like this @Matheus, you need a language that is server side, so if your javascript, angularjs, html and html5 is on the client side (and most likely it is) do not do it server execute command none, so in the case of php it would look like this:

<?php 
exec(' teste="ola mundo"'); 
exec('echo teste > arquivo.txt '); 
?>

So one solution would be to do an ajax in your javascript for php and do that over there, that would be a solution.

Of course this can be done in the same javascript but, however, however, you will need to use javascript on the server side, example to do this is nodeJs , follows a link to make the unix command magic direct from javascript (with nodeJs)

  

link

     

link

    
26.05.2015 / 20:14