Andre Poenitz wrote:
>> Point 2. Sometimes 'cut' is a better tool than 'sed'. I repectfully
>> submit that this:
>>
>>input=`grep�"Last-Translator"�$pofile`�&&�{
>> # Remove 'Last-Translator: ' from the front of the string
>>input=`echo�$input�|�sed�'s/��*/�/g'�|�cut�-d�'�'�-f�2-`
>> # The string now consists of "Jo Bloggs <jo@home>..."
>> # Use the < and > to extract the two parts.
>>translator=`echo�$input�|�cut�-d�'<'�-f�1�|�sed�'s/�*$//'`
>>email=`echo�$input�|�cut�-d�'<'�-f�2�|�cut�-d�'>'�-f�1`
>>}
>>
>> is cheaper and more robust than this:
>> grep "Last-Translator" $x |
>> sed -e 's/"Last-Translator: \(.*\)\(
> *\)<\(.*\)>\\n"/"translator" => "\1",
> Concerning cheapness:
>
> y=${x%<*}
> translator=${j#*�}
> y=${x#*<}
> email=${y%>*}
>
> should beat that. But that's a bash-ism, isn't it?
>
> Andre'
Never seen nothing like this. Can you explain it to me? It looks like
gook to me ;-)
Give me a little example of it in action and I'll try it here with
dumn old vanilla sh.
--
Angus