Akim Demaille wrote:

> Le 10 juil. 2012 à 12:05, Jim Meyering a écrit :
>
>> Akim Demaille wrote:
>>
>>> Le 10 juil. 2012 à 10:14, Jim Meyering a écrit :
>>>
>>>>> +  case $* in
>>>>> +    *$nl*) me_=$(printf "$me"|tr "$nl|" '??')
>>>>
>>>> Is it worth testing for both $nl and '|' ?
>>>
>>> I tried to keep what you did about $nl in $me (it would break
>>> the sed command).  I used printf, since the \n from echo gave
>>> a spurious ? at the end of $me.
>>
>> I meant "is it worth *also* testing for '|' there"?
>> E.g., if $me contains '|', but no newline.
>> Definitely not a big issue.
>
> Sorry, there must be something I am missing :/.

No, 'twas I.
If $me contains '|' there's no need for sed, as you say.

> I use sed when there are $nl in the messages (not
> in $me, just in $*).  And when I use sed, I avoid characters
> that can be troublesome for sed.
>
> But when there is no need to call sed, I just use
> $me as is, including with | and \n, as it should not
> be a problem.

Reply via email to