Folco: Tu as jamais fait de script shell un peu sérieux toi
(c'est hyper utilisé pour tout ce qui est affichage, ou création de fichiers, ça permet de faire un "echo" multiligne ou de créer un fichier rapidement ^^
(genre
cat <<EOF
usage: $0 -vh
-v : Set in verbose mode
-h : Show this help
EOF
(mbp-win:~ godzil$ cat test.sh
#!/bin/bash
cat <<EOF
usage: $0 -vh
-v : Set in verbose mode
-h : Show this help
EOF
mbp-win:~ godzil$ ./test.sh
usage: ./test.sh -vh
-v : Set in verbose mode
-h : Show this help
mbp-win:~ godzil$
)
(un exemple de script shell que j'avais créé il y a 1 ans pour utilisation au boulot :
#!/bin/bash
COMP=${1}
CID=`uuidgen`
echo "Make component ${COMP}..."
echo "CID: ${CID}"
mkdir ${COMP}
cd ${COMP}
cat > ${COMP}.dep << EOF
/*----------------------------------------------------------------------------
* ${COMP} Component - dependencies
*----------------------------------------------------------------------------
* Copyright (c) 1998-2007 Nexwave Solutions.
*----------------------------------------------------------------------------
*/
/* NSI includes */
#include <stdarg.h>
#include <nsi/component.h>
/* Definition of component dependencies */
#pragma NSI version 1.2
component {
/* Component description */
exported interface component {
/* Properties */
const nsi_uuid_t iid = "204f0640-5c25-4f80-8f3e-08c0ef562ba2";
/* Component information */
const nsi_string_t name = "${COMP}";
const nsi_string_t descr = "Change text here";
const nsi_uuid_t cid = "${CID}";
const nsi_version_t build = MAKE_VERSION (1, 0, 0);
/* Exported functions */
nsi_result_t Init (nsi_handle_t myHandle, void *viewPtr);
nsi_result_t Destroy (nsi_handle_t myHandle, void *viewPtr);
};
/* INSERT NEW INTERFACES HERE */
/* Import trace manager functionality */
# include <nsi/tracemgr.dep>
};
EOF
cat > Makefile << EOF
#----------------------------------------------------------------------------
# ${COMP} Component - Makefile
#----------------------------------------------------------------------------
# Copyright (c) 1998-2007 NexWave Solutions.
#----------------------------------------------------------------------------
# The top level must point to a parent directory where binaries will be build
# (ex: "." for current directory)
TOPLEVEL = .
# Write here your component name (must be the same as the .dep file name)
COMPONENT = ${COMP}
# List your .c files here
C_FILES += component.c
# Include NSI make rules
include \$(NEXPATH)/Rules.make
EOF
cat > ${COMP}.h << EOF
/*----------------------------------------------------------------------------
* ${COMP} Component - global header file
*----------------------------------------------------------------------------
* Copyright (c) 1998-2007 NexWave Solutions.
*----------------------------------------------------------------------------
*/
#include "${COMP}.dep.h"
/* Add tracemanager */
#include <nsi/tracemgr.h>
EOF
cat > component.c << EOF
/*----------------------------------------------------------------------------
* ${COMP} Component - component Interface
*----------------------------------------------------------------------------
* Copyright (c) 1998-2007 NexWave Solutions.
*----------------------------------------------------------------------------
*/
/* Common global definitions */
#include "${COMP}.h"
/* This component's handle. */
nsi_handle_t selfHandle;
/**
* This function is called by the dependency manager before any
* functionality exported by this component will be made available to
* others. This gives a chance to the component to set itself up,
* initialize global variables, allocate ressources, etc. This is
* typically also where drivers will try to locate whichever hardware
* they are handling. The component must be ready to service others
* as soon as this call returns.
*
* @param myHandle the component's handle.
* @param viewPtr the component's view.
*
* @return
* - 0 on success.
* - A negative error code defined in nexcore/errno.h on failure.
*
* @see Destroy()
*/
nsi_result_t Init (nsi_handle_t myHandle, void * viewPtr) {
nsi_result_t error;
/* Report success */
error = 0;
exit:
return error;
}
/**
* This function is called when the other components are no longer
* using the functionality provided by this component. It is given
* control just before the component is made unavailable and
* unloaded. This gives a chance to destroy or release all resources
* that were allocated by Init(), to save the state, and/or to perform
* any other clean-up actions.
*
* @param myHandle the component's handle.
* @param viewPtr the component's view.
*
* @return
* - 0 on success.
* - < 0 on error (see <nexcore/errno.h> for more details).
*/
nsi_result_t Destroy (nsi_handle_t myHandle, void *viewPtr) {
nsi_result_t error;
/* Report success */
error = 0;
exit:
return error;
}
EOF
echo "Done."
Dommage que ça ai peu servit au final

)
(un autre un peu plus elaboré qui utilise aussi cette construction :
http://box.godzil.net/~godzil/mklog )

Proud to be CAKE©®™
GCC4TI importe qui a problème en Autriche, pour l'UE plus et une encore de correspours nucléaire, ce n'est pas ytre d'instérier. L'état très même contraire, toujours reconstruire un pouvoir une choyer d'aucrée de compris le plus mite de genre, ce n'est pas moins)
Stalin est l'élection de la langie.