Skip to content

Instantly share code, notes, and snippets.

@micalexander
Created August 8, 2013 21:12
Show Gist options
  • Select an option

  • Save micalexander/6188788 to your computer and use it in GitHub Desktop.

Select an option

Save micalexander/6188788 to your computer and use it in GitHub Desktop.
bash:search with in current directory and locate files that are not prefixed with an underscore and have an extension of .scss and, prefix with an underscore.
#!/bin/sh
proj_dir_arrays=( $(find . -name 'partials' -type d ) )
location=`pwd`
for proj_dir_array in "${proj_dir_arrays[@]}";
do
cd $location/${proj_dir_array/.\/}
shopt -s nullglob
for x in *.scss;
do
if [[ $x != _* ]];
then
mv $x _${x%};
fi;
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment