giovedì 17 maggio 2012

Ksh script to remove shared memory

Today a simple script to remove shared memory in ksh :


#!/bin/ksh


#
# Shell Script to remove shared memory MVNO Instance
#


PID=$(ipcs -m | grep 0x000000a[0-9a-b] | awk '{print $2}'|xargs)
for one_pid in ${PID}; do
    ipcrm -m ${one_pid}
    echo 'Removed shm : ' ${one_pid}
done

This script remove all shared memory from address 0x000000a0 to 0x000000ab. You must modify this expression to remove another shared memory.

Stay tuned.


Nessun commento:

Posta un commento

Check first quarter 2024

 Hi all Today, 1st May I'll check my 2024 goals. This is the first time I check it. For me it's a good way to reach more objective p...