#!/bin/bash

    shmid=$(ipcs -m | grep -vE '(Shared | shmid)' | awk '{print $2}')

    for id in $shmid; do
        ipcrm -m $id
    done