Open main menu

Changes

812 bytes added ,  15:10, 15 May 2017
add quick directory comparison
<source lang="bash">
diff --suppress-common-lines --side-by-side modules.list.a.txt modules.list.b.txt |awk '{print $1}'
</source>
 
=== Process Substitution ===
By using process substitution, we can operate on the output of commands without the need for saving to a file.
<source lang="bash">
drush pml --status=enabled --pipe > modules.list.txt
# make a bunch of changes to what modules are enabled, perhaps restoring from a backup, and compare to our original list
 
diff --suppress-common-lines --side-by-side <(drush pml --status=enabled --pipe) modules.list.txt
</source>
 
This technique comes in handy if you wish to compare two directories at their top level. The '''extensions''' directory, for example, in [[MediaWiki]] from two different installations:
<source lang="bash">
diff --suppress-common-lines --side-by-side <(ls -1 /var/www/wiki.example.net/www/w/extensions/) <(ls -1 /var/www/wiki.example.org/www/w/extensions/)
</source>
4,558

edits