3

I'm bad at bash programming. Where is the error? Here is my .profile file:

# WARNING: For help understanding this file, and before you try
# to change any of it, type "man .profile" and read carefully.
#

#
# Set command search rules
#
if [ -x /bin/showpath ] ; then  
    export PATH; PATH=`/bin/showpath $HOME/bin /u/cs350/sys161/bin /software/gnu/bin standard`
    export PATH; PATH=`/bin/showpath usedby=user standard $HOME/bin`
#
# Find out what kind of terminal we are using
#
    eval `setterm  sytek:kd404  default:vc404`
#
# Set terminal-type dependent options (e.g. sysline or prompt string)
#
    #HOMEHOST="<hostname>"
    #HOMEUSER="<userid>"
    #export HOMEHOST HOMEUSER
    PS1="$ "
#
# Now do the usual signing on things
#
    export MAIL; MAIL=${MAIL-"/usr/spool/mail/$USER"}

if [ -r /software/.admin/bins/bin/read_system_news ] ; then /software/.admin/bins/bin/read_system_news ; fi

EOF
ghostdog74
  • 327,991
  • 56
  • 259
  • 343
name
  • 31
  • 1
  • 2

2 Answers2

7

Your first if is missing a fi.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
4

You are missing a fi at the end of file add it.

Also get rid of EOF. The EOF in your case is treated as a command.

Sometimes running your script using different shells gives you a clue about the error.

When we run your program using:

  • sh it says Syntax error: end of file unexpected (expecting "fi")
  • csh it says if: Expression Syntax.
codaddict
  • 445,704
  • 82
  • 492
  • 529