nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] changes to mark.man


From: Ralph Corderoy
Subject: Re: [Nmh-workers] changes to mark.man
Date: Mon, 20 Mar 2017 12:08:39 +0000

Hi Larry,

> #!/usr/local/bin/dash
> 
> repl=/usr/local/bin/repl
> repll="/usr/local/bin/repl -group"
> 
> case $(folder -fast) in
>       lists|obsd|nmh) list=1 ;;
>       *) : ;;
> esac
> 
> if [ $# -eq 0 ] ; then
>     scan cur > /dev/null 2>&1
>     err=$?
>     case "$err" in
>         0) cur=$(basename "$(mhpath cur)") ;;
>         1) echo "no cur" ; exit ;;
>         *) exit ;;
>     esac
>       if [ $list -eq 1 ] ; then
>               $repll "$cur"
>       else
>               $repl "$cur"
>       fi
> else
>       if [ $list -eq 1 ] ; then
>               $repll "$@"
>       else
>               $repl "$@"
>       fi
> fi

I think I see what that's doing.
Here's a shorter equivalent, hopefully.  :-)

    #! /usr/local/bin/dash

    test $# -eq 0 && set cur

    case "$(folder -fast)" in
        lists|obsd|nmh) g=-group;;
        *) g=;;
    esac

    exec /usr/local/bin/repl $g "$@"

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

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