To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / common_startstring.sh

History | View | Annotate | Download (256 Bytes)

1 0:4182672fd6f8 Chris
#!/bin/bash
2
filelist="$1"
3
common_st="`head -n 1 "$filelist"`"first
4
5
while read f; do
6
	diff_pos=`./diff_position.sh "$common_st" "$f"`
7
	last_same=$(( $diff_pos-1 ))
8
	common_st="`echo "$common_st" | cut -c 1-$last_same`"
9
done < "$filelist"
10
echo "$common_st"