Your sed command does not work for me with GNU sed
Code:
line='Tue May 26 00:00:05 CDT 2009|217|authenticate|jds'
echo "$line" | sed 's/\|jds//g'
Tue May 26 00:00:05 CDT 2009|217|authenticate|
# '|' has been left on the end of the line
# Removing the g switch makes it worse.
echo "$line" | sed 's/\|jds//'
Tue May 26 00:00:05 CDT 2009|217|authenticate|jds
# This works
# Escaping is unnecessary to get a literal '|' in a basic regex
echo "$line" | sed 's/|jds//'
Tue May 26 00:00:05 CDT 2009|217|authenticate