nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Sending Binary Attachments


From: Ralph Corderoy
Subject: Re: [Nmh-workers] Sending Binary Attachments
Date: Thu, 12 May 2016 23:23:48 +0100

Hi Paul,

Sorry, can't resist commenting on the shell script.  I realise it's old
and unedited in years.  :-)

> read inputline

bash's read has -r to turn off backslash processing.

> if echo "$inputline" | grep -qv '^-\+-:$'

bash provides [[ and, as well as the parsing of its operands being more
regular, its operators include == (AKA =) that do `extglob' matching,
thus

    if [[ $inputline == +(-) ]]; then ...

No need to double-quote $inputline.  No need to escape the parenthesis
in the glob.

Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]