Announcement

Collapse
No announcement yet.

Can't run scripts in Konsole (or any other way)

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

    Can't run scripts in Konsole (or any other way)

    I have a couple of software packages I'd like to install, each of which comes with an installation script file (names like "foobar.sh"). No matter what I do, they simply won't run!

    I know sometimes (every time?) you have to make the script "executable" with something like "chmod +x scriptname.sh." I did that, but they still won't run. All I get is an error message: "bash: command not found".

    I can't run them from the GUI either. Double-clicking does nothing.

    What's broken?

    #2
    Re: Can't run scripts in Konsole (or any other way)

    Check the first line... it should read:
    #! /bin/sh

    Scripts for other distros might read differently. (I think. I am certainly not an expert on scripts, but still worth checking.)

    Edit: Actually, that might not be good advice for troubleshooting an installation script... oh well, you got a bump.



    Edit 2: Yep, crappy. I just tried opening a 25 MB .sh file and it more or less wouldn't open in kate on my 3800 AMD.

    Comment


      #3
      Re: Can't run scripts in Konsole (or any other way)

      Originally posted by Objekt
      I have a couple of software packages I'd like to install, each of which comes with an installation script file (names like "foobar.sh"). No matter what I do, they simply won't run!
      What exactly are you typing to run them? If they're in a directory that's not in your path, simply typing the name will not work. You need to either run them using "./foobar.sh" or "sh foobar.sh". This is so that a trojan can't drop a script with the same name as a frequently called command in your current directory.

      I recommend creating a "bin" directory inside your home directory, and put any script commands you plan to use more than once in there. I believe it's added to your path at login by the default rc scripts, if it exists (remember to log out/in after creating it!).
      Specs:  Intel Core 2 Quad Q6600 (@3Ghz), G.SKILL 4GB DDR2 1066, ASUS Striker II Formula MB, Asus EN9800GTX+ Dark Knight, ABS Tagan BZ800 PS, Antec 900 Case.

      Comment


        #4
        Re: Can't run scripts in Konsole (or any other way)

        One is an install script for Teamspeak 2, the other is an installer for Urban Terror 4.1 for Linux. Neither one works.

        Teamspeak2 comes with a "setup.sh" script that's supposed to do it. I tried using "sh" as in:
        Code:
        sh setup.sh
        but I got a mysterious error message:
        Code:
        setup.sh: 17: Bad substitution
        No idea what that means.

        Later on, I found that Teamspeak is known to Adept, so I'm installing it that way.

        I sure wish I could figure out how to install things the "old fashioned" way. So far it's been impossible. If it's not in the repositories, I can't install it.

        Fortunately, Urban Terror turned out to be really simple. All I had to do was unzip the files to a folder, then manually enable the "executable" property of the executable file, then double-click. Boom. done.

        Comment


          #5
          Re: Can't run scripts in Konsole (or any other way)

          Originally posted by Objekt
          One is an install script for Teamspeak 2
          Glad to see you found that Teamspeak was already in the repos. It's much better to install things via a package manager, so that you get to easily see when updates are available.

          Obviously, the setup.sh shell script you were running has a problem - It's likely that it was not written to standard and uses something specific to Bash (kubuntu's sh is linked to Dash by default). Running it with "bash setup.sh" may have been successful.
          Specs:  Intel Core 2 Quad Q6600 (@3Ghz), G.SKILL 4GB DDR2 1066, ASUS Striker II Formula MB, Asus EN9800GTX+ Dark Knight, ABS Tagan BZ800 PS, Antec 900 Case.

          Comment


            #6
            Re: Can't run scripts in Konsole (or any other way)

            And another way of starting scripts is

            Code:
            ./script_name
            Try that...
            Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

            Comment

            Working...
            X