#!/bin/bash set -eu synopsis() { cat << EOF Usage : `basename $0` [-h] system EOF } help() { cat << EOF `basename $0` gestion des fichiers (disques, noyau/initramfs, ...). `synopsis` -h : affiche cette aide EOF } usage() { synopsis exit 1 } args() { local opt while getopts "h" opt; do case $opt in h) help; exit 0;; ?) usage;; esac done shift $(($OPTIND - 1)) [ $# -ne 0 ] && usage return 0 } manage() { cd $VDN_PATH/files du -h * | sort -h echo echo "Pour supprimer un fichier :" echo "rm fichier" echo #echo "Tapez exit (ou CTRL D) pour quitter ce shell" #echo #cd /tmp; PS1="exit (or CTRL D) to quit $ " bash --noprofile --norc -i } # Programme principal VDN_PATH=$(readlink -f $(dirname $0)/..); . $VDN_PATH/bin/functions.sh args "$@" #set -x manage