]> git.plutz.net Git - confetti/blobdiff - templates/view_attendee.sh
make use of improved parser
[confetti] / templates / view_attendee.sh
index 1394cedacae447feae5e644e5b97c493a53da9af..5966729e01611df62bb78485d186cf8ecefd1b0d 100755 (executable)
@@ -15,9 +15,8 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
 
-n=$(printf %s "$values[N]" \
-    | sed -rn 's:^([^;]*)(\;[^;]*)(\;[^;]*)?(\;[^;]*)?(\;[^;]*)?$:\4 \2 \3 \1 \5:gp' \
-    | sed -r 's:,: :;s:\;: :g;s: +: :g;s:^ $::;'
+n=$(printf %s "$values[N+3] $values[N+1] $values[N+2] $values[N+0] $values[N+4]" \
+    | sed -r ':X;$!{N;bX}; s;^[\n ]+;;; s;[\n ]+$;;; s;[\r\t\n ]+; ;g;'
    )
 fullname="${n:-${values[FN]:-${values[NICKNAME]}}}"