Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. bad variable name in sh file
Forum Updated to NodeBB v4.3 + New Features

bad variable name in sh file

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 5.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deleted286
    wrote on last edited by
    #1

    here is my .sh file
    when i run it in terminal i get ./yi.sh: 11: export: : bad variable name

    #!/bin/sh
    appname=`basename $0 | sed s,\.sh$,,`
    
    dirname=`dirname $0`
    tmp="${dirname#?}"
    
    if [ "${dirname%$tmp}" != "/" ]; then
    dirname=$PWD/$dirname
    fi
    LD_LIBRARY_PATH=$dirname
    export LD_LIBRARY_PATH =kitaplik/QmapControl979/Samples/bin
    export LD_LIBRARY_PATH =kitaplik/qwt-6.1/lib
    $dirname/$appname "$@"
    
    jsulmJ 1 Reply Last reply
    0
    • D deleted286

      here is my .sh file
      when i run it in terminal i get ./yi.sh: 11: export: : bad variable name

      #!/bin/sh
      appname=`basename $0 | sed s,\.sh$,,`
      
      dirname=`dirname $0`
      tmp="${dirname#?}"
      
      if [ "${dirname%$tmp}" != "/" ]; then
      dirname=$PWD/$dirname
      fi
      LD_LIBRARY_PATH=$dirname
      export LD_LIBRARY_PATH =kitaplik/QmapControl979/Samples/bin
      export LD_LIBRARY_PATH =kitaplik/qwt-6.1/lib
      $dirname/$appname "$@"
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @suslucoder There should not be space before =
      And also you are setting LD_LIBRARY_PATH three times, only second one will have effect.
      Do it like this:

      export LD_LIBRARY_PATH=$dirname:kitaplik/qwt-6.1/lib:kitaplik/QmapControl979/Samples/bin
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      JonBJ 1 Reply Last reply
      4
      • jsulmJ jsulm

        @suslucoder There should not be space before =
        And also you are setting LD_LIBRARY_PATH three times, only second one will have effect.
        Do it like this:

        export LD_LIBRARY_PATH=$dirname:kitaplik/qwt-6.1/lib:kitaplik/QmapControl979/Samples/bin
        
        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @jsulm said in bad variable name in sh file:

        There should not be space before =

        Damn, you beat me to it! How quickly do you see these new posts and reply?!

        jsulmJ 1 Reply Last reply
        2
        • JonBJ JonB

          @jsulm said in bad variable name in sh file:

          There should not be space before =

          Damn, you beat me to it! How quickly do you see these new posts and reply?!

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @JonB I'm only sometimes so fast :-)

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • jsulmJ jsulm

            @JonB I'm only sometimes so fast :-)

            D Offline
            D Offline
            deleted286
            wrote on last edited by
            #5

            @jsulm thank you. I fixed it and it solved. But know, im having a trouble with libQt5Charts.so.5

            I've give the directory but terminal cannot found it

            jsulmJ 1 Reply Last reply
            0
            • D deleted286

              @jsulm thank you. I fixed it and it solved. But know, im having a trouble with libQt5Charts.so.5

              I've give the directory but terminal cannot found it

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by jsulm
              #6

              @suslucoder Put that lib in same folder where your executable is.
              But you should actually take a look at https://doc.qt.io/qt-5/linux-deployment.html "Creating the Application Package"

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply
              1
              • jsulmJ jsulm

                @suslucoder Put that lib in same folder where your executable is.
                But you should actually take a look at https://doc.qt.io/qt-5/linux-deployment.html "Creating the Application Package"

                D Offline
                D Offline
                deleted286
                wrote on last edited by
                #7

                @jsulm I put them in the same folder already

                jsulmJ 1 Reply Last reply
                0
                • D deleted286

                  @jsulm I put them in the same folder already

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @suslucoder Change to the folder containing your executable and do:

                  ldd YOUR_EXECUTABLE
                  

                  and post the output here.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  D 1 Reply Last reply
                  2
                  • jsulmJ jsulm

                    @suslucoder Change to the folder containing your executable and do:

                    ldd YOUR_EXECUTABLE
                    

                    and post the output here.

                    D Offline
                    D Offline
                    deleted286
                    wrote on last edited by
                    #9

                    @jsulm

                    ```
                       linux-vdso.so.1 (0x00007fff5fdfd000)
                    libqmapcontrol.so.0 => not found
                    libqwt.so.6 => /usr/local/lib/libqwt.so.6 (0x00007f54ca578000)
                    libQt5Charts.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Charts.so.5 (0x00007f54ca1c4000)
                    libQt5Svg.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Svg.so.5 (0x00007f54c9f6e000)
                    libQt5PrintSupport.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5PrintSupport.so.5 (0x00007f54c9cfc000)
                    libQt5Widgets.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Widgets.so.5 (0x00007f54c94ad000)
                    libQt5Multimedia.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Multimedia.so.5 (0x00007f54c91a0000)
                    libQt5Gui.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Gui.so.5 (0x00007f54c8951000)
                    libQt5Network.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Network.so.5 (0x00007f54c85a9000)
                    libQt5SerialPort.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5SerialPort.so.5 (0x00007f54c8390000)
                    libQt5Core.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Core.so.5 (0x00007f54c7bf5000)
                    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f54c786c000)
                    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f54c74ce000)
                    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f54c72b6000)
                    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f54c6ec5000)
                    libQt5OpenGL.so.5 => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5 (0x00007f54c6c6e000)
                    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f54c6a4f000)
                    libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f54c67c3000)
                    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f54c65a6000)
                    libpulse-mainloop-glib.so.0 => /usr/lib/x86_64-linux-gnu/libpulse-mainloop-glib.so.0 (0x00007f54c63a1000)
                    libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f54c6151000)
                    libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f54c5e3a000)
                    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f54c5c36000)
                    libicui18n.so.56 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libicui18n.so.56 (0x00007f54c579d000)
                    libicuuc.so.56 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libicuuc.so.56 (0x00007f54c53e5000)
                    libicudata.so.56 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libicudata.so.56 (0x00007f54c3a02000)
                    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f54c3800000)
                    /lib64/ld-linux-x86-64.so.2 (0x00007f54ca8ce000)
                    libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f54c35cf000)
                    libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f54c3319000)
                    libpulsecommon-11.1.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so (0x00007f54c309a000)
                    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f54c2e4d000)
                    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f54c2bdb000)
                    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f54c28a3000)
                    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f54c267b000)
                    libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f54c23f7000)
                    libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f54c21ed000)
                    libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f54c1f74000)
                    libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f54c1d6e000)
                    libapparmor.so.1 => /lib/x86_64-linux-gnu/libapparmor.so.1 (0x00007f54c1b5e000)
                    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f54c1956000)
                    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f54c1752000)
                    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f54c154c000)
                    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f54c1326000)
                    liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f54c110a000)
                    libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f54c0dee000)
                    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f54c0bd4000)
                    libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f54c095d000)
                    libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f54c0754000)
                    libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f54c0529000)
                    libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f54c0280000)
                    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f54c0066000)
                    libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f54bfe51000)
                    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f54bfc3c000)
                    
                    jsulmJ 1 Reply Last reply
                    0
                    • D deleted286

                      @jsulm

                      ```
                         linux-vdso.so.1 (0x00007fff5fdfd000)
                      libqmapcontrol.so.0 => not found
                      libqwt.so.6 => /usr/local/lib/libqwt.so.6 (0x00007f54ca578000)
                      libQt5Charts.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Charts.so.5 (0x00007f54ca1c4000)
                      libQt5Svg.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Svg.so.5 (0x00007f54c9f6e000)
                      libQt5PrintSupport.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5PrintSupport.so.5 (0x00007f54c9cfc000)
                      libQt5Widgets.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Widgets.so.5 (0x00007f54c94ad000)
                      libQt5Multimedia.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Multimedia.so.5 (0x00007f54c91a0000)
                      libQt5Gui.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Gui.so.5 (0x00007f54c8951000)
                      libQt5Network.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Network.so.5 (0x00007f54c85a9000)
                      libQt5SerialPort.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5SerialPort.so.5 (0x00007f54c8390000)
                      libQt5Core.so.5 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libQt5Core.so.5 (0x00007f54c7bf5000)
                      libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f54c786c000)
                      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f54c74ce000)
                      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f54c72b6000)
                      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f54c6ec5000)
                      libQt5OpenGL.so.5 => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5 (0x00007f54c6c6e000)
                      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f54c6a4f000)
                      libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f54c67c3000)
                      libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f54c65a6000)
                      libpulse-mainloop-glib.so.0 => /usr/lib/x86_64-linux-gnu/libpulse-mainloop-glib.so.0 (0x00007f54c63a1000)
                      libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f54c6151000)
                      libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f54c5e3a000)
                      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f54c5c36000)
                      libicui18n.so.56 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libicui18n.so.56 (0x00007f54c579d000)
                      libicuuc.so.56 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libicuuc.so.56 (0x00007f54c53e5000)
                      libicudata.so.56 => /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib/libicudata.so.56 (0x00007f54c3a02000)
                      libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f54c3800000)
                      /lib64/ld-linux-x86-64.so.2 (0x00007f54ca8ce000)
                      libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f54c35cf000)
                      libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f54c3319000)
                      libpulsecommon-11.1.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so (0x00007f54c309a000)
                      libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f54c2e4d000)
                      libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f54c2bdb000)
                      libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f54c28a3000)
                      libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f54c267b000)
                      libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f54c23f7000)
                      libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f54c21ed000)
                      libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f54c1f74000)
                      libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f54c1d6e000)
                      libapparmor.so.1 => /lib/x86_64-linux-gnu/libapparmor.so.1 (0x00007f54c1b5e000)
                      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f54c1956000)
                      libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f54c1752000)
                      libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f54c154c000)
                      liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f54c1326000)
                      liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f54c110a000)
                      libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f54c0dee000)
                      libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f54c0bd4000)
                      libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f54c095d000)
                      libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f54c0754000)
                      libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f54c0529000)
                      libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f54c0280000)
                      libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f54c0066000)
                      libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f54bfe51000)
                      libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f54bfc3c000)
                      
                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @suslucoder You are mixing two Qt builds: one from /usr/local/lib and one from /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib. Why?
                      Please read the link I provided before.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      D 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @suslucoder You are mixing two Qt builds: one from /usr/local/lib and one from /home/ilknur/Qt5.12.10/5.12.10/gcc_64/lib. Why?
                        Please read the link I provided before.

                        D Offline
                        D Offline
                        deleted286
                        wrote on last edited by
                        #11

                        @jsulm i've read and i did the steps

                        make clean
                        PATH=/path/to/Qt/bin:$PATH
                        export PATH
                        qmake -config release
                        make
                        
                        jsulmJ 1 Reply Last reply
                        0
                        • D deleted286

                          @jsulm i've read and i did the steps

                          make clean
                          PATH=/path/to/Qt/bin:$PATH
                          export PATH
                          qmake -config release
                          make
                          
                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @suslucoder I'm talking about https://doc.qt.io/qt-5/linux-deployment.html "Creating the Application Package"

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved