![]() |
Execute .sh File
Hi,
I'm trying to run an app using these instructions: Open the Apple Terminal (located at: /Applications/Utilities) and go with the command line to the location the start.sh file is located. Then execute sh start.sh I have used cd to navigate to the directory start.sh is stored in and tried: sh start.sh I ended up with this error message: -bash: sh: command not found Does anyone know where I'm going wrong? Thanks. |
try ./start.sh. also, search the forum and look for Hayne's Unix FAQ, and read it. it will give you a much better grasp on the unix world.
|
I tried that and it gave me a permission denied error.
Will look at the faq you suggested and hopefully it will shed some light. |
It sounds like you have modified your shell's execution PATH (see the shell config section of that FAQ) and made a mistake in doing so such that "/bin" is no longer in your PATH.
To confirm this, please show us the results of the following command: echo $PATH |
I get this...
alan-moores-macbook:~ alan$ echo $PATH /usr/local/bin:/bin/sbin:/usr/bin:/usr/sbin:/usr/local/bin |
Quote:
Why not list it for us? ls -le ./start.sh file ./start.sh ... etc. |
Quote:
|
Hal means to go to the directory which contains start.sh, using a command similar to the one below, except with the actual path inplace of "/path/to/directory":
cd /path/to/directory Then show us a directory listing of only the start.sh file: ls -le ./start.sh Then show us additional information about the file type of start.sh: file ./start.sh It might also be good to show us the script, assuming that it is a script: cat ./start.sh If the script is too long to nicely fit into this forum thread, you could alternately just show us the first few lines head -n 20 ./start.sh Trevor |
thanks for the instructions. Will do this when I get home. In the mean time this is the application if that helps:
http://mac.softpedia.com/get/Finance/OpenbravoPOS.shtml |
Quote:
Code:
export PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin |
blb and hayne appear correct. [post #5 wasn't visible (or cached?) yet, when i posted #6.]
Problem is... we can't see where the problem is. This might show us: /usr/bin/grep -in -C1 path ~/.[bp]* /etc/{profile,bashrc} |
Here is the result of that command:
Code:
/Users/alan/.bash_history-9-dscacheutil -flushcacheexport PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin However, when I try echo $PATH it still shows as the old path: /usr/local/bin:/bin/sbin:/usr/bin:/usr/sbin:/usr/local/bin To edit the .profile I did this: 1. Edit your ~/.profile file. vi ~/.profile 2. Change path to: export PATH="/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin" 3. Save the file. 4. Quit the editor. The change takes effect immediately. 5. Check it with echo $PATH Thanks! |
If your .profile appears to be ignored, it's usually because you have a higher-priority dotfile which bash uses instead. Look for ~/.bash_profile or ~/.bash_login and check to see if PATH is being set there. If so, correcting that missing colon will probably get things right.
|
thanks!!
Had a .bash_profile Got rid of the line in that file which was setting the execution path and everything is good now. Got the app up and running. :) |
one more question. Is it possible to create a shortcut icon on my desktop which would launch terminal and execute start.sh?
Rather than having to do this normally? Edit: figured it out. Used applescript and this code: tell application "Terminal" activate do script "cd /applications/openbravopos" do script "sh start.sh" in window 1 end tell |
Well... there are many ways around the [original] problem.
However, the actual *source* of this error appears to be inside /etc/profile... Quote:
From the looks of things, my guess is 10.4.x. Here is a proper /etc/profile for (a stock) Tiger: Code:
# System-wide .profile for sh(1) |
I'm running snow leopard.
|
Quote:
Let's see the whole thing with... cat /etc/profile May as well list it too... ls -l /etc/profile |
alan-moores-macbook:~ alan$ cat /etc/profile
# System-wide .profile for sh(1) PATH="/bin/sbin:/usr/bin:/usr/sbin:/usr/local/bin" export PATH if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi alan-moores-macbook:~ alan$ ls -l /etc/profile -r--r--r-- 1 root wheel 172 Feb 20 2009 /etc/profile |
That's pretty strange... because it looks like a mangled Tiger profile. I don't have Snowy yet... but in Leopard, Apple went with the path_helper script to build the $PATH variable:
Code:
$ cat /etc/profileAnyway, there's no denying the "/bin/sbin:" in your profile there [post #19] is the bug. |
Quote:
[tried finding it on the web, but no luck yet] |
/etc/profile on my 10.6.1 machine is identical to your 10.5 version...
|
Quote:
EDIT: stuff like that bothers me... it makes one wonder what else is florfed, that isn't apparent as yet. |
| All times are GMT -5. The time now is 10:19 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.