#!/bin/bash [ "$HOSTNAME" != lime2 ] || exit 1 for folder in ~/tssr/procedures/*; do if [ -d "$folder" ]; then name=$(basename "$folder") if [[ "$name" = *chose* ]]; then echo ignoring "$name" else echo found "$name" cp "$folder"/procedure*.pdf ./procedures-tssr/procedure_"$name".pdf fi fi done