LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell Script Does Not Run (https://www.linuxquestions.org/questions/linux-newbie-8/shell-script-does-not-run-898630/)

hitmen 08-21-2011 10:46 AM

Shell Script Does Not Run
 
c@c-laptop:~/Desktop/tor-browser_en-US$ start-tor-browser
start-tor-browser: command not found

c@c-laptop:~/Desktop/tor-browser_en-US$ start-tor-browser.sh
start-tor-browser.sh: command not found

c@c-laptop:~/Desktop/tor-browser_en-US$ ls -la
total 36
drwxr-xr-x 8 c c 4096 2011-08-20 02:43 .
drwxr-xr-x 8 c c 4096 2011-08-21 20:44 ..
drwxr-xr-x 3 c c 4096 2011-08-20 02:43 App
drwxr-xr-x 5 c c 4096 2011-08-20 02:43 Data
drwxr-xr-x 5 c c 4096 2011-08-20 02:43 Docs
drwxr-xr-x 3 c c 4096 2011-08-20 02:43 Lib
drwxr-xr-x 3 c c 4096 2011-08-20 02:43 .mozilla
-rwxr-xr-x 1 c c 2538 2011-08-20 02:43 start-tor-browser
drwxr-xr-x 2 c c 4096 2011-08-20 02:43 tmp

c@c-laptop:~/Desktop/tor-browser_en-US$ start-tor-browser
start-tor-browser: command not found

c@c-laptop:~/Desktop/tor-browser_en-US$ start-tor-browser.sh
start-tor-browser.sh: command not found


I am trying to open start-tor-browser using command prompt but it does not work.

Nylex 08-21-2011 10:49 AM

When you use the shell, it looks in a list of directories called the PATH, to locate commands you give it. Usually, the current directory is not in the PATH, so you need to explicitly tell the shell where to find the script. This can be done by prefixing the name with "./", since . is shorthand for the path to the current directory.

jdkaye 08-21-2011 10:51 AM

Code:

./start-tor-browser
Your home directory is not in your path. The above command will work if run from your home directory.
You need to read up on the linux file system.
ciao,
jdk


All times are GMT -5. The time now is 08:14 PM.