Linux4One/Ubuntu - shell problem

Discussion in 'Linux' started by masonnj, Feb 15, 2009.

  1. masonnj

    masonnj

    Joined:
    Jan 8, 2009
    Messages:
    12
    Likes Received:
    0
    I write this in the hope of saving someone a bit of time. :)

    I needed to write a shell script to do some stuff, nothing very complicated just a bit of automation.

    When I'd done the damned thing wouldn't run, I was getting a basic syntax error on line 1 of the script. There was nothing wrong with line 1, or any of the script that I could see but it just wouldn't run. In desperation I wrote a three line "Hello world" script to prove my sanity and that wouldn't run either!

    Having been a Unix user 20 odd years ago I'm used to running shell scripts by typing sh script.sh

    After a lot of digging around I discovered that if I typed bash script.sh it worked fine! My problem was with a symbolic link in the /bin directory on the sh entry. Instead of the sym link pointing to /bin/bash it was pointing to /bin/dash :!:

    Replacing the sym link with the correct one fixed my problem. A bit of searching seems to indicate that this is a know Ubuntu/Linux4One issue.

    I have no idea if this will be useful to anyone else but hey ho.

    Nick
     
    masonnj, Feb 15, 2009
    #1
  2. masonnj

    Japser

    Joined:
    Aug 28, 2008
    Messages:
    267
    Likes Received:
    0
    Japser, Feb 15, 2009
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.