socle_bash/lib/what.lib

33 lines
1016 B
Plaintext
Executable File

##----------------------------------------------------------------------------
## Script : what.lib
## Module Puppet : gnc-script_core_dtsi
## Auteur : Emmanuel Confrere
## Date : 10-02-2016
## Version : 1.1.0-1
## Objet : Fournie la version et l objet du fichier passe en parametre
##
## Fonction : what Nom_Fichier
##
## Detail :
##
# ----------------------------------------------------------------------------
# Mise a jour :
# 1.0.0-0 24-01-2008 - Emmanuel - Creation
# 1.0.0-1 06-06-2008 - Emmanuel - Correction des noms de variable
# 1.1.0-0 06-06-2008 - Emmanuel - Ajout recherche fichier
# 2.0.0-0 10-02-2016 - Emmanuel Confrere - Integration au socle DTSI
##----------------------------------------------------------------------------
what()
{
local L_FICHIER=`which $1`
if [ -f ${L_FICHIER} ]
then
grep "^## Version" ${L_FICHIER}|sed 's/#* *//'
grep "^## Objet" ${L_FICHIER}|sed 's/#* *//'
fi
}
typeset -fx what