nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Sending Binary Attachments

2016-05-12 17:24:04
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.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>