Path: utzoo!utgpu!watserv1!watcgl!andrewt From: andrewt@watsnew.waterloo.edu (Andrew Thomas) Newsgroups: gnu.bash.bug Subject: bahs 1.04 core dumps reading a script file Message-ID: Date: 1 Dec 89 23:09:36 GMT Sender: daemon@watcgl.waterloo.edu Organization: University of Waterloo, Waterloo, Ontario, Canada Lines: 53 Running bash 1.04 on a uVaxII, Ultrix 2.0 I have a shell file which is read when I log in to set my functions. This one causes a core dump; ------------------------ function distr () { local machines='watnext watsnew watsup watever watif watsleft' local current=`/bin/hostname` local curdir=$PWD if [ "$1" = "-m" ] ; then shift machines="$1" shift done <-- should be fi if [ -z "$1" ] ; then echo "Usage: distr [-m machine] [file...]" return fi for file in $* ; do if [ ! -f "$file" ] ; then echo Distr: $file: not a plain file. else for i in $machines ; do if [ "$i" != "$current" ] ; then echo cp -p $file /nfs/${i}${curdir}/$file cp -p $file /nfs/${i}${curdir}/$file fi done fi done } ----------------------------------------- I marked the error in the script, 'done' instead of 'fi'. It should still not produce a crash. The output from bash is: watsnew.2.102> bash -norc bash$ . ./tshell syntax error near `done' ./tshell:10: ` done' Usage: distr [-m machine] [file...] can only `return' from a function syntax error near `}' ./tshell:27: `}' watsnew.2.103> -- Andrew Thomas andrewt@watsnew.waterloo.edu Systems Design Eng. University of Waterloo "If a million people do a stupid thing, it's still a stupid thing." - Opus