[MPlayer-dev-eng] Not [PATCH] - entire file

GoTaR gotar at poczta.onet.pl
Mon Dec 23 18:08:10 CET 2002


Hi!

On Mon, Dec 23, 2002 at 17:18:59 +0100, Arpi wrote:

> > redundant
> 
> not really.
[...]
> the major difference is that my version works with multi-line defines, while

Yes, you're right. I forgot about them.

> > details. It works with bash, zsh, pdksh and ash, And please, try to
> > avoid bashisms in the future.
> 
> i was happy even with the bash version :)

Yeah, but not everyone - switch sh to ksh (from pdksh) and try to
interrupt this script without kill -9 ;-)
Anyway - every distro with sh linked to bash should be assumed to be
broken. Additionaly bash is slow, much slower than pdksh or zsh is,
what can be especially noticed when running configure scripts.

> please try to fix your script to handle multiple lines, or fix my version to
> be bash-independent.

In this situation it was easier to fix yours. I applied these 3 points
(fixed locking echo, removed excessive cut to make script a bit faster
and shortened grep) and changed copy mark from "x" to "" in order to use
-z and -n tests.
Oh, sorry for reformated spacing - I was working on my copy:/ I hope it
won't be a problem to do diff -iwB, would be?

cya

-- 
GoTaR <priv0.onet.pl->gotar>
PLD stuff at http://mops.uci.agh.edu.pl/~gotar/



***************r-e-k-l-a-m-a**************

Masz dosc placenia prowizji bankowi ?
mBank - zaloz konto
http://epieniadze.onet.pl/mbank 
-------------- next part --------------
#!/bin/sh

# This script walks through the master (stdin) help/message file, and
# prints (stdout) only those messages which are missing from the help
# file given as parameter ($1).
#
# Example: help_diff.sh help_mp-hu.h < help_mp-en.h > missing.h

curr=""

while read -r line; do
	if echo -E "$line" | grep -q '^#define'; then
		curr=`echo -E "$line" | cut -d ' ' -f 2`
		if grep -q "^#define $curr " $1; then
			curr=""
		fi
	else
		if [ -z "$line" ]; then
			curr=""
		fi
	fi

	if [ -n "$curr" ]; then
		echo -E "$line"
	fi
done


More information about the MPlayer-dev-eng mailing list