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 s开发者_开发问答ytek: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
Your first if
is missing a fi
.
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 saysSyntax error: end of file unexpected (expecting "fi")
csh
it saysif: Expression Syntax.
精彩评论