scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit 480783541cf7d36b7e004458e8325f5c2f4b66de
parent f98054173ae1bbe9c3a68cb78d65a7f29348b142
Author: sin <sin@2f30.org>
Date:   Fri Jul  5 11:56:39 +0100

Add fdclose

Diffstat:
fdclose | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/fdclose b/fdclose @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ ! $# -eq 1 ]; then + echo "usage: $(basename $0) <pid>" 2>&1 + exit 1 +fi + +for i in /proc/$1/fd/*; do + read -p "fd $i points to $(readlink $i) - close it?" + if [[ ${REPLY} = [yY] ]]; then + echo "p close($i)" | gdb -p $1 + fi +done