trimming trailing slashes in variable

I'm using this thread as an example, but can't seem to apply it to my situation.

I'm trying to strip the trailing slash (/) from an input argument. Here's a snippet of my command line input and the troublesome code:

$ script_name -s "../pathname/dir/"
snip 8< ...
while getopts :s: FLAGNAME
do
    case $FLAGNAME in
s) start_dir=$OPTARG
start_dir=`echo "${start_dir}" | sed ` s/[^\/]\/+$ //``
echo $start_dir # should be ../pathname/dir
;;
    h)  echo "Wrong syntax"
    exit 1
;;
done

I get an error s/[: not found

try removing the space after sed..

oh and it should be quotes not `..
so the sed statement would be

start_dir=`echo "${start_dir}" | sed ' s/[^\/]\/+$ //`'
echo '../pathname/dir//' | sed 's#/*$##'

` != '

....
start_dir=`echo "${start_dir}" | sed 's#/*$##'`
....

oh yeah missed the first ` for the echo..thanks for pointing it out.

Thanks for the responses.

I was able to get this to work with the desired results:

start_dir=`echo "${start_dir}" | sed -e "s/\/*$//" `