Announcement

Collapse
No announcement yet.

opening .sh files and lots of other questions

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    opening .sh files and lots of other questions

    Preliminary info: I'm running Kubuntu 13.04 in VirtualBox on my iMac, which is running Mac OS 10.7.3.
    1 gb ram and 20 gb storage are allocated to the VM; I have 4 gb ram and 500 gb storage in total.
    Kubuntu is using KDE 4.10.5. Apparently my Grub version is "0.97-29ubuntu66" whatever that means.
    I have Java installed, in case that has any bearing on my issues.

    I feel like I should apologise for having so many questions, lol.

    1. There is a rather obscure programming environment called JES (Jython Environment for Students - you can find it here https://code.google.com/p/mediacomp-jes/) which I'm required to use for uni work. It's a .sh file, and in Xubuntu double-clicking on the file immediately launches the program. However, in Kubuntu it just opens in a text editor. At the top of the file, there is a comment:

    #!/bin/sh
    # launches JES on mac and linux

    I'm not even sure what that means, but I tried !/bin/sh in terminal anyway. It said event not found.

    There are instructions here for installing and launching JES in Linux: http://personal.denison.edu/~bressou...lJESLinux.html

    As far as I can see, this is saying that typing the path to the file into Terminal will launch it. I've tried that and it just says command not found.

    The most 'successfull' command I've tried yet is bash filepath, which seems to at least do something:

    sh: 0: Can't open ./list-jars.sh
    Error: Could not find or load main class JESstartup

    I spoke to a friend about this and he thought I might be missing a package that allows .sh files to open automatically. Any ideas?


    2. I have 'show hidden files' turned on in Dolphin, but when I do a search, it's still not showing me all the system files. For instance, I wanted to find the color scheme files (which are stored in .kde/share/apps/color-schemes) so I could put them on my USB stick. I eventually found the folder by trial and error, but it really annoyed me that when I searched for the names of the files they didn't come up, even though I had 'show hidden files' checked. Is there any way to index these kind of files? Ideally, I would like every single file on my computer to be indexed, so I can search for anything and be assured of finding it.


    3. I frequently need to know app commands, yet they're ridiculously hard to get hold of. Yesterday I had to google the command for an app in order to add it in the KDE menu editor (long story), and then I couldn't understand why it was crashing every time I opened it. Turns out the command I found on Google was wildly out of date (I googled some more and eventually found the correct command.)
    The only way I know of for finding out the command is googling it and hoping some documentation comes up. Is there any other way?

    4. How can I make Kubuntu recognise my mic and webcam? There might be some hardware compatibility issues here as I'm running it as a VM on an iMac. The microphone issue is less important at the moment; mostly I'd just like to see something when I open up Kamoso. Kamerka actually gives me an error ('Cannot connect to V4L device'). However, I want to use Kamoso because it can record video as well....

    5. How do I get Sylpheed to display all the fancy images/buttons/etc in automated emails from websites? I unchecked 'render HTML messages as text' in the preferences, but it hasn't changed anything.
    Last edited by dbaker; Jul 29, 2013, 09:49 PM.
    "Stella", HP Pavilion 15-ak006TX: KDE Neon User Edition dual-booted with Windows 10, 8gb RAM, Intel i7-6700HQ CPU, NVIDIA GeForce GTX950M graphics, 2 TB hard drive

    #2
    1. For the sh file, open a terminal and go to the directory where the file is. Then type:
    Code:
    ./filename.sh
    2. I usually search in the terminal with the locate command.
    Code:
    locate filename
    3 ~ 5 Dont know. Sorry
    Last edited by Snowhog; Jul 29, 2013, 10:17 PM.

    Comment


      #3
      1. That's what I've already tried. proof that it doesn't work:

      dorothea@kubuntu-VirtualBox:~$ /home/dorothea/jes-4-3-nojava/
      bash: /home/dorothea/jes-4-3-nojava/: Is a directory
      dorothea@kubuntu-VirtualBox:~$ ./JES.sh
      bash: ./JES.sh: No such file or directory

      Am I doing something wrong?

      2. Thanks, that's a pretty neat command! I've figured out how to index source code in nepomuk, but it's taking FOREVER to do it, so terminal is probably a better solution.

      Now I have another question. I have a Dolphin launcher in my panel thingy, it was there by default. I'd like to be able to add Konsole and Firefox there as well but I don't know how to. I've dug around in the 'add widgets' collection and can't find anything. You can have 2 kinds of application menu listing all the apps, but I can't find a launcher for individual apps.
      Last edited by dbaker; Jul 30, 2013, 03:58 AM.
      "Stella", HP Pavilion 15-ak006TX: KDE Neon User Edition dual-booted with Windows 10, 8gb RAM, Intel i7-6700HQ CPU, NVIDIA GeForce GTX950M graphics, 2 TB hard drive

      Comment


        #4
        Originally posted by dbaker View Post
        #!/bin/sh
        This is called the 'shebang' (http://en.wikipedia.org/wiki/Shebang_%28Unix%29)
        It just tells the system that the file is a script that should be run with Bourne shell (/bin/sh)...you don't need to worry about that.

        Originally posted by dbaker View Post
        1. That's what I've already tried. proof that it doesn't work:
        dorothea@kubuntu-VirtualBox:~$ /home/dorothea/jes-4-3-nojava/
        bash: /home/dorothea/jes-4-3-nojava/: Is a directory
        dorothea@kubuntu-VirtualBox:~$ ./JES.sh
        bash: ./JES.sh: No such file or directory

        Am I doing something wrong?
        You need to use the 'cd' (change directory) command to change directories:
        cd /home/dorothea/jes-4-3-nojava/

        Comment


          #5
          I tried that and it said Permission Denied, so I tried it with sudo and it said command not found...
          "Stella", HP Pavilion 15-ak006TX: KDE Neon User Edition dual-booted with Windows 10, 8gb RAM, Intel i7-6700HQ CPU, NVIDIA GeForce GTX950M graphics, 2 TB hard drive

          Comment


            #6
            Originally posted by dbaker View Post
            I tried that and it said Permission Denied, so I tried it with sudo and it said command not found...
            Is the script set executable:
            What does 'ls -l /home/dorothea/jes-4-3-nojava/JES.sh' output?

            Comment


              #7
              -rw-rw-r-- 1 dorothea dorothea 372 Dec 16 2009 /home/dorothea/jes-4-3-nojava/JES.sh
              "Stella", HP Pavilion 15-ak006TX: KDE Neon User Edition dual-booted with Windows 10, 8gb RAM, Intel i7-6700HQ CPU, NVIDIA GeForce GTX950M graphics, 2 TB hard drive

              Comment


                #8
                Originally posted by dbaker View Post
                -rw-rw-r-- 1 dorothea dorothea 372 Dec 16 2009 /home/dorothea/jes-4-3-nojava/JES.sh
                It's not set executable:

                1. 'cd /home/dorothea/jes-4-3-nojava' (if you're not already in the directory)
                2. 'chmod +x JES.sh' (this will set the 'executable' permissions)
                3. './JES.sh' (try running it, post any errors here)

                Comment


                  #9
                  Ok, that worked! Problem is, when I close terminal it closes JES as well. Any way round that?
                  "Stella", HP Pavilion 15-ak006TX: KDE Neon User Edition dual-booted with Windows 10, 8gb RAM, Intel i7-6700HQ CPU, NVIDIA GeForce GTX950M graphics, 2 TB hard drive

                  Comment


                    #10
                    Originally posted by dbaker View Post
                    Ok, that worked! Problem is, when I close terminal it closes JES as well. Any way round that?
                    You could use 'nohup' to prevent it closing when closing the terminal:
                    'nohup ./JES.sh'

                    But you should be able to create a shortcut icon in kmenu, for example, to avoid having to launch from terminal. Just use '/home/dorothea/jes-4-3-nojava/JES.sh' as the command to run in the shortcut (it should work now, as the script is set executable)

                    Comment


                      #11
                      Ok, I made the shortcut, but it just tries to load for a bit and then quits without anything happening...
                      "Stella", HP Pavilion 15-ak006TX: KDE Neon User Edition dual-booted with Windows 10, 8gb RAM, Intel i7-6700HQ CPU, NVIDIA GeForce GTX950M graphics, 2 TB hard drive

                      Comment


                        #12
                        Originally posted by dbaker View Post
                        Ok, I made the shortcut, but it just tries to load for a bit and then quits without anything happening...
                        hmm...what happes if you try to start with the full path from terminal (any errors?):

                        1. 'cd' (change to home directory)
                        2. '/home/dorothea/jes-4-3-nojava/JES.sh'

                        Comment


                          #13
                          it says 'not a directory'....very weird
                          "Stella", HP Pavilion 15-ak006TX: KDE Neon User Edition dual-booted with Windows 10, 8gb RAM, Intel i7-6700HQ CPU, NVIDIA GeForce GTX950M graphics, 2 TB hard drive

                          Comment


                            #14
                            Originally posted by kubicle View Post
                            hmm...what happes if you try to start with the full path from terminal (any errors?):

                            1. 'cd' (change to home directory)
                            2. '/home/dorothea/jes-4-3-nojava/JES.sh'
                            Forgot the ".". Shouldnt it be "./home/dorothea/jes-4-3-nojava"?

                            Comment


                              #15
                              Originally posted by whatthefunk View Post
                              Forgot the ".". Shouldnt it be "./home/dorothea/jes-4-3-nojava"?
                              Nope. the dot (./) means current working directory, as in ./JES.sh (run JES.sh from current working directory, needed because it's not in $PATH)...it's not needed when using an absolute path.

                              it says 'not a directory'....very weird
                              This might be because expects to run in current directory (the script may use commands with relative paths), try:
                              'cd /home/dorothea/jes-4-3-nojava/ && ./JES.sh'
                              you can also post the contents of the script JES.sh so we can take a look

                              Comment

                              Working...
                              X