#!/bin/bash -l for VER in $(module avail -t cuda 2>&1 | grep -E "^cuda" | cut -d ' ' -f 1); do module purge LOADERR=$(module load "$VER" 2>&1 | grep -i "not installed" | wc -l) if [ "$LOADERR" = "1" ]; then continue; fi PVER=${VER/\//-} cat <