What makes the . command behave this way? Please share some "dot" wisdom
with a fellow shell programmer.
I am trying to do some PATH manipulation in a ksh function that gets
defined by .profile. The problem is that my function leaves running jobs
that are not really running. I cannot exit the shell without taking
care of these things. I have read all I can find on ksh and the .
command but I still do not understand why I get this.
Short and sweet 1 line example you can try yourself;
(file called try.ksh)
echo "start" | grep "a"Quote:> cat try.ksh
start { works fine }Quote:> try.ksh
start { again works fine }Quote:> jobs
> { no jobs running right? }
> . try.ksh
[1] + Done . try.kshQuote:> jobs
There it is! Its 'Done' but it won't go away until I run jobs or some
other attempt to find out why it is still around.
I have tried sed, cut, and a few other methods to test for a duplicate
string but this seems to be the cleanest.
----- snip from actual script -------------------------
# Eliminate duplicates in PATH
# No longer want to rely on pathuniq due to it's perl dependency
#
NewPath=":"
#
do
# Have we added this path before?
echo $NewPath | \grep ":${PathElem}:" > /dev/null
[ $? -eq 0 ] && continue
# Append this Path element to New path
NewPath="${NewPath}${PathElem}:"
done
NewPath="${NewPath}:"
NewPath=`echo $NewPath | sed "s?::??g"`
----------- end of snip -------------------------------
========================================================================
Product Development Engineer Phone: (513)576-2400
Structural Dynamics Research Corp. Ext: x2479
2000 Eastman Drive Fax: (513)576-7591
Milford OH 45150 Web: http://www.sdrc.com/
========================================================================
I fight entropy, but entropy always wins. O-
------------------------------------------------------------------------