Skip to content

Instantly share code, notes, and snippets.

@scicco
Last active July 3, 2020 09:04
Show Gist options
  • Save scicco/6429ff20945c054f9aa13785bf15123e to your computer and use it in GitHub Desktop.
Save scicco/6429ff20945c054f9aa13785bf15123e to your computer and use it in GitHub Desktop.
print .ruby-version file of all subfolders
#!/bin/bash
for file in *;
do
if [ -f "./$file/.ruby-version" ]; then
cat "$file/.ruby-version" | sed -e 's/ruby-//g' | tr '\n' ' ';
echo "in folder: $file";
fi
done;
### example:
# ./print_ruby_version.sh | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment