User login

compare

Understanding past changes with diff and git log

In figuring out what changed in a theme's files (an incorrectly made subtheme; instead of overriding the base themes stylesheets, changes should have gone into its own files with different names), these commands were useful.


diff -uP themes/bartik/css/colors.css sites/default/themes/dgd7theme/css/style.css > theme.diff
git log --cc sites/default/themes/dgd7theme/css/style.css > log.diff

Kept running them for the three different files, and reloading theme.diff and log.diff in gvim to see the changes. Quite convenient.

Compare two strings in a bash script

bash script compare text

if [ $var == "value" ]
then
echo is the same
fi

http://www.tech-recipes.com/rx/209/bournebash-shell-scripts-string-comparison/

(Numbers are -eq)

Syndicate content