/.cshrc: Syntax error: unexpected end of file
Hello to all the wonderful people out there,
I am a newbie in the world of Linux (obviously!!!!). I would love to get some help regarding the following matter. I am trying to install a software called SPARTA+. While installing I sourced the .cshrc file and I faced the following error when . /.cshrc: line 5: syntax error: unexpected end of file This is how the .cshrc file looks like if (-e $SPARTAP_Dir/sparta+Init.com) then source $SPARTAP_Dir/sparta+Init.com endif It will be great if someone can tell me what's wrong with this .cshrc file or what does the error mean. Thank you |
I guess the file $SPARTAP_Dir/sparta+Init.com was not ok, but without details hard to say more.
|
Yes indeed.
Put Code:
set echo |
looks like an ad for asian software funded by USA to me. also - it says it's gains are "modest"
also, "set echo" is NOT AN ANSWER, and csh is default shell in freeBSD not linux |
/.cshrc: line 5: syntax error: unexpected end of file IS THE PROBLEM
the sytax in this case doesn't work in bash or csh if i remember a little csh correctly if [ -e $SPARTAP_Dir/sparta+Init.com ] ; then source $SPARTAP_Dir/sparta+Init.com endif if (-e $SPARTAP_Dir/sparta+Init.com) ; then source $SPARTAP_Dir/sparta+Init.com endif if $(test -e $SPARTAP_Dir/sparta+Init.com) ; then source $SPARTAP_Dir/sparta+Init.com endif |
https://spin.niddk.nih.gov/bax/software/SPARTA+/
The instructions are for macOS (and apparently "linux9"... RHEL9?) and assume that either csh or tcsh are installed. You should post the whole contents of ~/.cshrc, along with the distribution you are using and what you enter to produce the error, if you expect to receive any meaningful assistance. |
Missing line terminator probably, incompatible editor.
|
^Nope. Tried it with tcsh 6.20.00, 6.21.00, and csh 20110502. All of them recognize scripts without the trailing newline just fine.
|
OP said they sourced it, never mentioned what shell was used. It may been even bash.
|
Quote:
Code:
$ cat script.csh |
I saw 2 things in line 5
Code:
if (-e $SPARTAP_Dir/sparta+Init.com) then |
@computersavvy. No. This is csh. Even the white space around parentheses is optional. The following is perfectly correct in csh:
Code:
if(-e $SPARTAP_Dir/sparta+Init.com)then |
All times are GMT -5. The time now is 02:51 AM. |