Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-9067

[fiware-stackoverflow] send: command not found - CentOS 6.2

    Details

      Description

      Created question in FIWARE Q/A platform on 02-01-2016 at 15:01
      Please, ANSWER this question AT https://stackoverflow.com/questions/34566852/send-command-not-found-centos-6-2

      Question:
      send: command not found - CentOS 6.2

      Description:
      I'm trying to execute the next script (run.sh):

      #!/bin/sh

      1. Rooms and Floors example

      CEP=localhost:8080

      . ../common.sh

      1. Send an updateContext request with Room temp
        function sendRoomTemp() #(url, floor, room, value)
        {
        payload='{
        "contextElements": [
        Unknown macro: { "type"}

        ],
        "updateAction": "APPEND"
        }'

      send $1 "v1/updateContext" "$payload"
      }

      echo "#1 First update CEP with RoomsAndFloors configuration"
      CONFIG=`cat config.json`
      updateConfig $CEP "$CONFIG"

      echo ""
      echo "#2 Then send T° of all the rooms to the CEP every 5 sec"

      for temp in 12 14 18 20 24 19; do

      echo ""
      echo "# Wait between temperatures updates..."
      echo ""
      sleep 5

      for room in 1 2 3 4; do
      for floor in 1 2 3; do

      1. compute a unique temp for each room
        t=$(($temp + (2*$floor) + $room))
        echo " - Send updateContext for Room$floor$room with T°=$t"
        out=$(sendRoomTemp $CEP "Floor$floor" "Room$floor$room" "$t")
        echo " $out"
        done
        done
        done

      And when I execute sh run.sh I get:

      ....

      1. Wait between temperatures updates...
      • Send updateContext for Room11 with T°=15
        run.sh: line 34: send: command not found
      • Send updateContext for Room21 with T°=17
        run.sh: line 34: send: command not found
        ....

      The script is from FIWARE Cepheus tutorial https://fiware-cepheus.readthedocs.org/en/latest/examples/1_RoomsAndFloors/index.html

      My machine is CentOS 6.2

      How I can fix it?

      Thanks!

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        Assignee Backlog Manager [ backlogmanager ]
        veronika Veronika Vlnkova made changes -
        HD-Enabler Cepheus [ 10883 ]
        Description
        Created question in FIWARE Q/A platform on 02-01-2016 at 15:01
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/34566852/send-command-not-found-centos-6-2


        +Question:+
        send: command not found - CentOS 6.2

        +Description:+
        I'm trying to execute the next script (run.sh):

        #!/bin/sh
        # Rooms and Floors example

        CEP=localhost:8080

        . ../common.sh

        # Send an updateContext request with Room temp
        function sendRoomTemp() #(url, floor, room, value)
        {
            payload='{
                "contextElements": [
                    {
                        "type": "Room",
                        "isPattern": "false",
                        "id": "'$3'",
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "double",
                                "value": '$4'
                            },
                            {
                                "name": "floor",
                                "type": "string",
                                "value": "'$2'"
                            }
                        ]
                    }
                ],
                "updateAction": "APPEND"
            }'

            send $1 "v1/updateContext" "$payload"
        }

        echo "#1 First update CEP with RoomsAndFloors configuration"
        CONFIG=`cat config.json`
        updateConfig $CEP "$CONFIG"

        echo ""
        echo "#2 Then send T° of all the rooms to the CEP every 5 sec"

        for temp in 12 14 18 20 24 19; do

            echo ""
            echo "# Wait between temperatures updates..."
            echo ""
            sleep 5

            for room in 1 2 3 4; do
                for floor in 1 2 3; do
                    # compute a unique temp for each room
                    t=$(($temp + (2*$floor) + $room))
                    echo " - Send updateContext for Room$floor$room with T°=$t"
                    out=$(sendRoomTemp $CEP "Floor$floor" "Room$floor$room" "$t")
                    echo " $out"
                done
            done
        done


        And when I execute sh run.sh I get:

         ....
         # Wait between temperatures updates...

         - Send updateContext for Room11 with T°=15
        run.sh: line 34: send: command not found

         - Send updateContext for Room21 with T°=17
        run.sh: line 34: send: command not found
        ....


        The script is from FIWARE Cepheus tutorial https://fiware-cepheus.readthedocs.org/en/latest/examples/1_RoomsAndFloors/index.html

        My machine is CentOS 6.2

        How I can fix it?

        Thanks!
        Created question in FIWARE Q/A platform on 02-01-2016 at 15:01
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/34566852/send-command-not-found-centos-6-2


        +Question:+
        send: command not found - CentOS 6.2

        +Description:+
        I'm trying to execute the next script (run.sh):

        #!/bin/sh
        # Rooms and Floors example

        CEP=localhost:8080

        . ../common.sh

        # Send an updateContext request with Room temp
        function sendRoomTemp() #(url, floor, room, value)
        {
            payload='{
                "contextElements": [
                    {
                        "type": "Room",
                        "isPattern": "false",
                        "id": "'$3'",
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "double",
                                "value": '$4'
                            },
                            {
                                "name": "floor",
                                "type": "string",
                                "value": "'$2'"
                            }
                        ]
                    }
                ],
                "updateAction": "APPEND"
            }'

            send $1 "v1/updateContext" "$payload"
        }

        echo "#1 First update CEP with RoomsAndFloors configuration"
        CONFIG=`cat config.json`
        updateConfig $CEP "$CONFIG"

        echo ""
        echo "#2 Then send T° of all the rooms to the CEP every 5 sec"

        for temp in 12 14 18 20 24 19; do

            echo ""
            echo "# Wait between temperatures updates..."
            echo ""
            sleep 5

            for room in 1 2 3 4; do
                for floor in 1 2 3; do
                    # compute a unique temp for each room
                    t=$(($temp + (2*$floor) + $room))
                    echo " - Send updateContext for Room$floor$room with T°=$t"
                    out=$(sendRoomTemp $CEP "Floor$floor" "Room$floor$room" "$t")
                    echo " $out"
                done
            done
        done


        And when I execute sh run.sh I get:

         ....
         # Wait between temperatures updates...

         - Send updateContext for Room11 with T°=15
        run.sh: line 34: send: command not found

         - Send updateContext for Room21 with T°=17
        run.sh: line 34: send: command not found
        ....


        The script is from FIWARE Cepheus tutorial https://fiware-cepheus.readthedocs.org/en/latest/examples/1_RoomsAndFloors/index.html

        My machine is CentOS 6.2

        How I can fix it?

        Thanks!
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: