#!/bin/bash help() { echo "Install packages from a requirements file." echo echo "Syntax: $0 [-h] " echo "Options:" echo "h Print this help." } if [ $# -eq 0 ] then help exit 1 fi packages=() for f in $@ do if [ $f == "-h" ] then help exit 0 fi for p in `sed 's/#.*//' $f` do packages+=($p) done done /usr/bin/apt install ${packages[@]} exit $?