I would like to write a sed statement that removes the last comma.
DROP TABLE IF EXISTS person;$
CREATE TABLE person ($
id int(11) NOT NULL,$
name varchar(500) DEFAULT NULL,$
gender char(1) DEFAULT NULL,$
birthdate date DEFAULT NULL,$
deathdate date DEFAULT NULL,$
height int(11) DEFAULT NULL,$
) ;$
code snippet is from vim with :set list
The wanted output is
DROP TABLE IF EXISTS person;$
CREATE TABLE person ($
id int(11) NOT NULL,$
name varchar(500) DEFAULT NULL,$
gender char(1) DEFAULT NULL,$
birthdate date DEFAULT NULL,$
deathdate date DEFAULT NULL,$
height int(11) DEFAULT NULL$
) ;$
I tryed to do it like this
sed -e 's@,$)@$)@'
but it does not match