Results 1 to 6 of 6

Thread: bash script, (idiot-level!)

  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,085

    Default bash script, (idiot-level!)

    Hi guys I have a little script which would be very useful to me, there seems however to be an error in the last line. I am 100% non-expert when it comes to scripting/programming, the sight of a curly bracket {what are they called?} makes my head swim!!!

    Anyhoo the problem is here:

    Code:
    71 cd $DIR
    72 script_path=$(dirname "${0}")
    73 "$script_path"/jre/bin/java -cp pokerclient.jar:resources.jar:ext-resources.jar ui.PokerClientApp
    The script returns:
    Code:
    poker_launcher.sh: line 73: ./jre/bin/java: No such file or directory
    $DIR is defined earlier in the script, but this, line 72 is the first mention of dirname.

    Tumbleweed/KDE/Ati Radeon R9 270/AMD FX-6300/8Gb DDR3

  2. #2
    Join Date
    Nov 2010
    Location
    Ελλάδα(Αθήνα)-Россия (г. Красноярск)
    Posts
    1,711

    Default Απ: bash script, (idiot-level!)

    Code:
    poker_launcher.sh: line 73: ./jre/bin/java: No such file or directory
    You must install or write this line in this directory.
    Πάντα Φιλικά, Στάμος.
    Desktop: openSUSE Leap 15.3||x86_64||Gnome 3.14 & KDE 5||AMD Ryzen 7 8 core||Nvidia GTX 1080 Ti Gaming Edition
    Γλώσσες Προγραμματισμού: C++, Qt developing.
    http://bit.ly/fT8Hfi

  3. #3
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,085

    Default Re: bash script, (idiot-level!)

    ps, if I manually cd to to $DIR and then issue line 73, replacing $script_path with the actual path to the jre, (ie. like this on my machine-)
    stephen@linux-p9sz:cd ~/bin/Devilfish/SKINS/devilfish
    stephen@linux-p9sz:~/bin/Devilfish/SKINS/devilfish> ~/bin/Devilfish/jre/bin/java -cp pokerclient.jar:resources.jar:ext-resources.jar ui.PokerClientApp

    ......then the app launches as expected. As I say I have no knowledge of programming/scripting, and am groping in the dark, but this surely means that the problem is in line 72?

    Tumbleweed/KDE/Ati Radeon R9 270/AMD FX-6300/8Gb DDR3

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,085

    Default Re: Απ: bash script, (idiot-level!)

    Quote Originally Posted by stamostolias View Post
    Code:
    poker_launcher.sh: line 73: ./jre/bin/java: No such file or directory
    You must install or write this line in this directory.
    Sorry Stamostolias, but your reply means even less to me than does "script_path=$(dirname "${0}") !!

    Tumbleweed/KDE/Ati Radeon R9 270/AMD FX-6300/8Gb DDR3

  5. #5
    Join Date
    Nov 2009
    Location
    Uruguay
    Posts
    742

    Default Re: bash script, (idiot-level!)

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    what is the output of the script if you put echo "$script_path" on the
    line 73? it would be ~/bin/Devilfish/ but on the error is .

    - --
    VampirD

    Microsoft Windows is like air conditioning
    Stops working when you open a window.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.15 (GNU/Linux)
    Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

    iEYEARECAAYFAk2nHykACgkQJQ+0ABWtaVmnEgCeMkrV8h5WBJGDTQIHulAZMgmF
    /eYAnj7AJ+tF5Wjn6N6N2Y/WQYbcuGT2
    =Z/8f
    -----END PGP SIGNATURE-----

  6. #6
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,085

    Default Re: bash script, (idiot-level!)

    VampirD Thank-you for the reply, I have been busy and not had time to try the script with your suggestions, I have it working, by telling it where to look explicitly, I will try to look in to it further as soon as I can...

    Tumbleweed/KDE/Ati Radeon R9 270/AMD FX-6300/8Gb DDR3

Posting Permissions

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