can't get a script to run

Asked by Richard Edell on 2006-06-07

I cannot get a script to run.

I have write a simple script to echo a word.

I chmod to 777 so all privleges are open.

I type the name of the script hello.sh and get command unknown.

I type just hello and get the same response.

What am I doing wrong.

I am trying to set up tomcat and can't seem to get any script to work.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

Try ./hello.sh , hello.sh isn't in the $PATH and then the shell can't execute. Another posibility if ./hello.sh fails is to add a first line to the script like this

#! /bin/bash

This indicates the shell that the file is a bash shell script, substitute bash with your shell (sh,tcsh,ksh...)

Can you help with this problem?

Provide an answer of your own, or ask Richard Edell for more information if necessary.

To post a message you must log in.