Hi Simon and Team,
The original skulker removes the file only if no process has it currently open.
This is for AIX OS.
I have placed core as an example which may not be valid, since I am trying to move from current skulker to skulker2, want to make sure we keep the same functionality.
Please advise.
3466skulker
#!/usr/bin/bsh
# @(#)28 1.31 src/bos/usr/sbin/skulker/skulker.sh, cmdcntl, bos42G, g9713A 3/20/97 16:25:42
#
# COMPONENT_NAME: (CMDCNTL) system control commands
#
# FUNCTIONS:
#
# ORIGINS: 27
#
# (C) COPYRIGHT International Business Machines Corp. 1989, 1996
# All Rights Reserved
# Licensed Materials - Property of IBM
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
# Remove the file only if no process has it currently open
# WARNING: THE WHOLE PURPOSE OF THIS SCRIPT IS TO REMOVE FILES,
# SO IT HAS THE POTENTIAL FOR UNEXPECTED RESULTS.
remove_file()
{
if · -z ² /usr/sbin/fuser $1 2>/dev/null² `; then
/usr/bin/rm -f $1
fi