Mass rename .css.scss to .scss (bash script)
During a Rails 3.x to Rails 4 upgrade, I recently had to rename a bunch of files with the .css.scss extension to .scss
Here's how I renamed about 200 files in about 2 seconds:
#!/bin/bash
declare -a files=$(du -ha app/assets/stylesheets | grep ".css.scss" | cut -f 2)
for i in $files; do
mv "$i" "${i/.css.scss/.scss}"
done
Written by Matenia Rossides
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#