#!/bin/bash ## usage: bash cleanup-Squiz.WhiteSpace.SuperfluousWhitespace.EndLine.sh vi ## usage: bash cleanup-Squiz.WhiteSpace.SuperfluousWhitespace.EndLine.sh joe [ -n "$1" ] && EDITOR="$1" if [ -z "$EDITOR" ]; then echo "Please provide parameter 1 (editor). Example: vi, joe" exit 1 fi function edit_at_line() { local f="$1" local l="$2" $EDITOR +$l "$f" } echo Process cleanup for 'Squiz.WhiteSpace.SuperfluousWhitespace.EndLine' echo Number of lines: 2 echo Examples: 'Array ( [0] => Whitespace found at end of line ) ' echo Press ENTER to begin read edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 158 edit_at_line 'CRM/Contribute/Form/ContributionPage/Settings.php' 159