MacOS script to open all files in a directory

The following script will open all files of type

.py

in the directory it is placed. Save as a

.command

file and make executable:

#!/bin/bash
#open all files of a certain type

mydir="$(dirname "$BASH_SOURCE")"

FILES="$mydir/*.py"
    for f in $FILES
    do
        open -a TextWrangler $f
        echo $f
    done
Creative Commons License
This work by pete is licensed under a Creative Commons Attribution 4.0 International