I need to run the program NACCESS on my MacOS X High Sierra.
The most prominent error is if: Expression Syntax.
This error is probably because the NACCESS executable is a CSH script with #!/bin/csh on its first line.
I changed the first line to #!/bin/bash and began getting errors such as
./naccess: line 14: syntax error near unexpected token `1'
./naccess: line 14: ` exit(1)'
Again, I think this is happening because the executable needs to be executed in a CSH shell, not bash. exit(1) is formatted for the CSH shell, whereas bash would want exit 1, according to this resource.
I tried typing csh into Terminal to switch shells, but an echo $SHELL command just tells me I'm still in bash.
I looked at my shell choices with grep '^#!' /usr/bin/* and cannot find any CSH shells. I attempted to download tcsh using homebrew. But I really have no idea what I'm doing at this point.
I know CSH shells aren't encouraged, but how do I get a CSH shell up and running on my Mac, or how do I otherwise get NACCESS to run?
[EDIT] Here are the first few lines of the NACCESS code:
(Note that I am running it with the .pdb file argument and also that I have set path_to_naccess_repository appropriately. I do get the usage naccess pdb_file [-p probe_size] [-r vdw_file] [-s stdfile] [-z zslice] -[hwyfaclqb] readout if I run only ./naccess)
#!/bin/csh
set EXE_PATH = /path/to/repo
#naccess_start
set nargs = $#argv
if ( $nargs < 1 ) then
echo "usage naccess pdb_file [-p probe_size] [-r vdw_file] [-s stdfile] [-z zslice] -[hwyfaclqb]"
exit(1)
endif
set PDBFILE = 0
set VDWFILE = 0
set STDFILE = 0
set probe = 1.40
set zslice = 0.05
set hets = 0
set wats = 0
set hyds = 0
set full = 0
set asao = 0
set cont = 0
set oldr = 0
set nbac = 0
while ( $#argv )
switch ($argv[1])
case -[qQ]:
echo "Naccess2.1 S.J.Hubbard June 1996"
echo "Usage: naccess pdb_file [-p probe_size] [-r vdw_file] [-s stdfile] [-z zslice] -[hwyfaclq]"
echo " "
echo "Options:"
echo " -p = probe size (next arg probe size)"
echo " -z = accuracy (next arg is accuracy)"
echo " -r = vdw radii file (next arg is filename)"
echo " -s = standard accessibilities file (next arg is filename)"
echo " -h = hetatoms ?"
echo " -w = waters ?"
echo " -y = hydrogens ?"
echo " -f = full asa output format ?"
echo " -a = produce asa file only, no rsa file ?"
echo " -c = output atomic contact areas in asa file instead of accessible areas"
echo " -l = old RSA output format (long)"
echo " -b = consider alpha carbons as backbone not sidechain"
echo " -q = print the usage line and options list"
echo " "
exit
breaksw
case -[pP]:
shift
set probe = $argv[1]
breaksw
case -[zZ]:
shift
set zslice = $argv[1]
breaksw
case -[hH]:
set hets = 1
breaksw
case -[wW]:
set wats = 1
breaksw
case -[yY]:
set hyds = 1
breaksw
case -[rR]:
shift
set VDWFILE = $argv[1]
breaksw
case -[sS]:
shift
set STDFILE = $argv[1]
breaksw
case -[fF]:
set full = 1
breaksw
case -[aA]:
set asao = 1
breaksw
case -[cC]:
set cont = 1
breaksw
case -[lL]:
set oldr = 1
breaksw
case -[bB]:
set nbac = 1
breaksw
default:
if ( -e $argv[1] && $PDBFILE == 0 ) then
set PDBFILE = $argv[1]
endif
breaksw
endsw
shift
end
#
if ( $PDBFILE == 0 ) then
echo "usage: you must supply a pdb format file"
exit(1)
endif
[EDIT] I did NOT set the path appropriately >.< So this question is mainly about how to get a csh script running in bash. There are no problems with this csh script.
exit(1)throwing an error. If I change it toexit 1, it moves on to the next syntax error.tcsh ./naccess?/bin/cshand/bin/tcshboth ship with macOS.