Hello Gordon,

Shell scripts don't execute when invoked unless you have changed file 
permissions on your system to allow them to execute.  This is a security 
precaution, because you don't, in general, want arbitrary scripts to run on 
your system without your express permission, and by default the files you 
create or copy will not have executable privilege.

If I want to run a shell script from the Terminal command line, I first make it 
executable:

chmod +x scriptname

If you only want the script owner to be able to execute the script, type:

chmod u+x scriptname

In this example, substitute the actual name of the script for "scriptname".  

Then, run the script with the command:

./scriptname

The "dot" "slash" typed before the name of the script (with no spaces) refers 
to the current directory, which is not usually included in your $PATH (which 
are the directories that are searched by default for executable files).

Presumably the script takes care of the one-time installation, and you won't 
use it again.  

Those two commands typed from Terminal -- the "chmod +x" before the scriptname 
to make sure the file is executable and the "./scriptname" to run the shell 
script file named "scriptname" should be all you need.

Technically, you also need to allow "read" permission to a shell script file in 
order to run it, but you already have it in most cases, including the case you 
describe.  The alternative to running the "chmod" command to change the 
permissions mode of a file, if you have the file and directory on another 
attached disk,  is to copy the file with the "cp -p" option.  The "-p" switch 
preserves the permissions of the file you are copying, which includes 
executable status for shell script files.

HTH Cheers,

Esther



On Sep 7, 2014, at 7:57 AM, Gordon Smith <gor...@mac-access.net> wrote:

> Hello everybody
> 
> I have a problem to which I’m hoping somebody can give me a definitive 
> response.  I have an application which I need to install on to a machine, but 
> the application in question was ported from LINUX and installs via a shell 
> script.  When I open the script in the usual way, it is opening Xcode rather 
> than installing as I had expected.  Is this normal behaviour and, if so, is 
> there a work-around?
> 
> Many thanks.
> 
> Gordon
> 
> <--- Mac Access At Mac Access Dot Net --->
> 
> To reply to this post, please address your message to 
> mac-access@mac-access.net
> 
> You can find an archive of all messages posted    to the Mac-Access forum at 
> the list's public Mail Archive:
> <http://www.mail-archive.com/mac-access@mac-access.net/>.
> Subscribe to the list's RSS feed from:
> <http://www.mail-archive.com/mac-access@mac-access.net/maillist.xml>
> 
> As the Mac Access Dot Net administrators, we always strive to ensure that the 
> Mac-Access E-Mal list remains malware, spyware, Trojan, virus and worm-free.  
> However, this should in no way replace your own security strategy.  We assume 
> neither liability nor responsibility should something unpredictable happen.
> 
> Please remember to update your membership preferences periodically by 
> visiting the list website at:
> <http://mail.tft-bbs.co.uk/mailman/listinfo/mac-access/options/>
<--- Mac Access At Mac Access Dot Net --->

To reply to this post, please address your message to mac-access@mac-access.net

You can find an archive of all messages posted    to the Mac-Access forum at 
the list's public Mail Archive:
<http://www.mail-archive.com/mac-access@mac-access.net/>.
Subscribe to the list's RSS feed from:
<http://www.mail-archive.com/mac-access@mac-access.net/maillist.xml>

As the Mac Access Dot Net administrators, we always strive to ensure that the 
Mac-Access E-Mal list remains malware, spyware, Trojan, virus and worm-free.  
However, this should in no way replace your own security strategy.  We assume 
neither liability nor responsibility should something unpredictable happen.

Please remember to update your membership preferences periodically by visiting 
the list website at:
<http://mail.tft-bbs.co.uk/mailman/listinfo/mac-access/options/>

Reply via email to