A blog about software by Alexander Yaäkov Garber.

Move files to backup and back out

To append “.bak” to files in a list:

for FILE in (cat failing_specs.txt);
  mv $FILE "$FILE.bak"
end

To remove the “.bak” suffix:

for FILE in (find spec/* -name "*.bak");
  echo "$FILE" | sed 's/\.bak//'
end