Question

I've been stuck on this syntax error for hours, could someone help me out?

root@wxserv:~/rap# source ~/.cshrc
bash: /home/kbroeren/.cshrc: line 9: syntax error near unexpected token `('
bash: /home/kbroeren/.cshrc: line 9: `  set cdpath = ( ~ )'
root@wxserv:~/rap# 

This is the .cshrc file with the part that causes the error:

#########################################
# .cshrc file for TITAN project
#########################################

if ( $?prompt ) then
set prompt = "`hostname`:\!>"
set autoexpand
set autolist
set cdpath = ( ~ )
set pushdtohome
endif
Was it helpful?

Solution

.cshrc uses C shell syntax which is altogether incompatible with Bash.

OTHER TIPS

Strange, that they include these scripts to install the package... What is the best thing i can do to get this work ?

They may have built it to only work from the C shell, or they may have built it to work from a number of shells in which case the rc file for your shell should be used and the .cshrc file should be ignored. If there are other C shell scripts in the project then it may be easiest to just use a C-like shell.

However, the .cshrc file is mainly setting interactive features. It shouldn't be necessary that this is required to install or run a package if it is well written. Are you sure you need to source the file or is some other script sourcing it?

For educational purposes only the following is the .cshrc file translated to Bash as close as I can get it. Beware: this may not fix your problem; that depends on what the project requires and what your environment is which you have not told us.

if [ "$PS1" ]; then
    PS1="`hostname`:\!>"        # Set prompt to hostname + history number
    set -o histexpand          # Enable history expansion (I think it is enabled by default in Bash anyway)
#   set autolist                 List possibilities after an ambiguous completion - this is done in .inputrc
    CDPATH=~                   # You probably don't want this! You probably have ~ within your CDPATH already and you might have other directories which this command would remove.
#   set pushdtohome              Sets default for `pushd` - I don't know equivalent in Bash
fi
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top