Re: List Opens for OSS file
- From: "Joachim Schmitz" <jojo.nospam@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2011 08:38:54 +0200
Brandon Jenkins wrote:
Does anyone have a working version of LSOF running on a blade (J-
Series)?
http://en.wikipedia.org/wiki/Lsof
I have the following script for this:
#!/bin/ksh
# Copyright (C) 2005, 2009, 2011 and unsupported by
# Joachim Schmitz <schmitz <at> hp <dot> com>
# Version History:
# 08Mar2005: first version
# 14Dec2009: additions as per KBNS Solution gcsc29461
# 24Mar2011: improvments as per KBNS Solution gcsc29461
for f in $@
do
if [ -f "$f" ]
then
l=$(gtacl -p fup listopens $(gname -s "$f") | tail +4 |
awk '{print $NF}')
if [ ! -z "$l" ]
then
f=$(gname "$f")
l=$(pname "$l" 2>/dev/null | cut -d: -f2 | head -1)
if [ -z "$l" ]
then
printf "%s is open\n" "$f"
else
printf "%s is opened by %s\n" "$f" "$l"
fi
fi
else
echo "${0##*/} works on files only and \"$f\" is not a file"
&2fi
done
Bye, Jojo
.
- References:
- List Opens for OSS file
- From: Brandon Jenkins
- List Opens for OSS file
- Prev by Date: Passing a set of values without using global variables
- Next by Date: Re: Passing a set of values without using global variables
- Previous by thread: List Opens for OSS file
- Next by thread: Passing a set of values without using global variables
- Index(es):