[Assorted-commits] SF.net SVN: assorted:[1012] shell-tools/trunk/src
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-10-10 22:18:41
|
Revision: 1012 http://assorted.svn.sourceforge.net/assorted/?rev=1012&view=rev Author: yangzhang Date: 2008-10-10 22:18:27 +0000 (Fri, 10 Oct 2008) Log Message: ----------- added dupes for printing duplicate lines Modified Paths: -------------- shell-tools/trunk/src/bash-commons/assorted.bash Added Paths: ----------- shell-tools/trunk/src/dupes.py Modified: shell-tools/trunk/src/bash-commons/assorted.bash =================================================================== --- shell-tools/trunk/src/bash-commons/assorted.bash 2008-10-09 06:23:31 UTC (rev 1011) +++ shell-tools/trunk/src/bash-commons/assorted.bash 2008-10-10 22:18:27 UTC (rev 1012) @@ -208,6 +208,7 @@ publish() { stage + scp -o Compression=on -o CompressionLevel=9 "$stagedir" tar czf - -C "$stagedir" . | ssh $prof " set -o errexit -o nounset Added: shell-tools/trunk/src/dupes.py =================================================================== --- shell-tools/trunk/src/dupes.py (rev 0) +++ shell-tools/trunk/src/dupes.py 2008-10-10 22:18:27 UTC (rev 1012) @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +from commons.seqs import pairwise +from commons.startup import run_main +from sys import stdin, stdout + +def main(argv): + cur = None + for a,b in pairwise(stdin): + if cur!=a and a==b: + stdout.write(a) + cur = a + +run_main() Property changes on: shell-tools/trunk/src/dupes.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |