#!/bin/env bash INFOFILE=info-gather-OCT8-1.txt OUTFILE=~/${INFOFILE} touch $OUTFILE if [ ! -w ${OUTFILE} ]; then echo -e "\n\nERROR: Unable to open output file for writing. Exiting\n" exit 1 fi getinfo() { echo "Datetime: $(date)" echo "User: $(id -un) ($(id -u))" echo "" echo "=== DKMS status ===" dkms status echo "" echo "=== Listings ===" for thepath in /var/lib/dkms /var/lib/dkms/nvidia /var/lib/dkms/akvcam/* ; do echo "" echo "--- $thepath ---" ls -lAh $thepath done } echo "" > $OUTFILE getinfo | tee $OUTFILE echo -e "\n\nPlease share the file ${OUTFILE} with me."