Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote the following

cd ~/bin/red5-1.0.0
gnome-terminal --working-directory=. -x red5.sh

red5.sh is the script to run (this is java written media server).

My script above opens new terminal but with error message

There was an error creating the child process for this terminal
Failed to execute child process "red5.sh" (No such file or directory)

What can be the cause? I am at Ubuntu 11.10

share|improve this question
up vote 3 down vote accepted

The working directory does not affect your $PATH1, thus I guess what's happening can be understood if you do the same thing in a terminal, i.e.

$ cd ~/bin/red5-1.0.0
$ red5.sh

will not work either; what does work is one of the following:

$ cd ~/bin/red5-1.0.0
$ ./red5.sh            # note the relative path to the script


$ cd ~/bin/red5-1.0.0
$ export PATH=~/bin/red5-1.0.0:$PATH   # add the path to $PATH which is where 
$ red5.sh                              # the shell looks for red5.sh

So, guessing that gnome-terminal works similar (regarding where it looks for executables), you could probably alter your script in one of these ways, too.

1: If your $PATH does not contain ., as Kevin pointed out (How about other relative paths, btw?).

share|improve this answer
Great! This was a mistake! – Dims Nov 30 '12 at 10:30
But this solution will run the script waiting until it ends. He wants it not to wait, so the & symbol should be appended at the end of the running command. – Onturenio Nov 30 '12 at 10:53
Just a note, "The working directory does not affect your $PATH". This isn't always true. Some people have the current directory (export PATH=.:/usr/local/bin:...) in which case the effective PATH will differ based on the directory you are in. – Kevin Cox Nov 30 '12 at 16:59
Ha, right. Thanks, added a note. – sr_ Nov 30 '12 at 22:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.