#!/bin/bash files="tmp1.py tmp2.py tmp3.py tmp4.py tmp5.py" for file in $files do if [ ! -f "$file" ]; then touch "$file" git add "$file" fi done