Can´t run a bash script

  • Hello thank you for the adoption.

    I´m not Expert. I´m a beginner.

    I have the following Problem:;(

    I have a bash script and when I run the script with Putty in the Terminal it works fine, but not with cinemavision .cvaction.

    This is the script:

    #!/bin/bash

    echo -ne '\x02PON\x03' | tee | nc 192.168.188.52 1002


    1) I write in the Terminal:

    cd /downloads

    2) Then I run the script in the Terminal with this Command:
    bash -x skript.sh

    And all works great!!!!:thumbup:

    if I write: "cd /downloads/skript.sh" I get an error Message

    The skript.sh is in downloads

    In Cinemavision I can run a bash skript, but need to write the correct path. The "example.cvaction" can run the bash script.

    My .cvaction is:

    command:///storage/downloads/skript.sh

    But this doesn´t work. :( :thumbdown: Hope you can help me.

  • First thank you for the answer!

    Okay I type in Terminal "chmod +x /storage/downloads/skript.sh" first

    then I try to run " /storage/downloads/./skript.sh"

    The answer I get is:

    -sh: /storage/downloads/./skript.sh: not found

    Don´t know If it is important: I run LibreELEC on a Odroid C2

  • I save the script.sh in the folder:" downloads"

    Is it possible that there is the mistake?

    I copy my script.sh in the existing folder: "downloads" .

    When I open the folder I can see the scripte.

    If I run bash -x skript.sh in the Terminal (directory downloads) it works.

  • Quote

    if I write: "cd /downloads/skript.sh" I get an error Message

    You can't 'cd' into a file. 'script.sh' is a file and 'cd' means 'change directory'. It's normal that you will get an error message then. Just cd into the directory where the file is located. So only 'cd /downloads/' and then enter a 'ls -al' to see if the file ist there.

    But I highly guess that the path is wrong, as you can't create a folder on '/' because that part is write protected. So I guess we are talking about '/storage/downloads/'. Please check if the path to the file is really correct.. try: cd /storage/downloads

    Btw, you should write sh-scripts and not bash scripts, as LibreELEC doesn't have a real bash, IIRC. And on the other hand, don't use *.sh as an extension for bash scripts. *.sh normally means that you are writing a sh-script which is in multiple ways different from bash scripts. Don't use extensions for bash scripts at all. That's the way it's normally done.

    And yes...please decide if we are talking about 'skript.sh' or 'script.sh'. Each of them might be a completely different file.

  • okay I write:"cd /storage/downloads" and I´m in the downloads folder (very good).

    I enter ls -all and there is the file:

    -rwxr-xr-x 1root root 66 Sep 28 22.25 beameron.sh

    I write script (skript) only as an example. The original name of the .sh is beameron.sh an I write it correct.

    It looks like that in LibreELEC everything is ok.

    But how can I now send the command to open the file using Cinemavision, because command:"///storage/downloads/beameron.sh" doesn´t work?

    The curious is: when I write in the Terminal "bash -x beameron.sh" the command works and Power on my Beamer, but I need a command that I run in Cinemavision. So I think the beameron.sh script isn´t the problem.

    In the jpeg you can see how the error looks like in Cinemavision:

    PS. the old .sh named beamer_On.sh and now I change to beameron.sh so don´t care about it.

    Edited 2 times, last by Dreamaxx (September 30, 2017 at 9:14 AM).

  • And there will always be 'experts' on the sidelines only capable of making "smart" remarks like you do.

    And what you are doing genius????

    And Yes at least i saw it.

    why don't you comment their "so called" help?

  • I'm the guy that will kick you off this forum if your attitude doesn't change for the better.

    Yes that's really what I thought you are only be capable of doing. Go ahead close my account please. Are you going to close registration too.... wait you are just a "janitor" -

    You wrote that I was only capable of writing a "smart" remark is that the attitude you mean??? then you really should grow up.Who do you think you are to define what other can or cannot do.

    You should be the first to comment the genius above but I guess it's funny joking around others even when you're are WRONG.

    There is a saying : " Vai dar banho ao cão e lava-te na mesma água".

    /shrug