Source: http://miage.univ-nantes.fr/miage/DVD-MIAGE-SystemeEtArchitecture/systeme/travaux-diriges/TD2_programmation-shell/correction_TD2_programmation-shell.pdf