OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Liviu Daia (Liviu.Daiaimar.ro)
Date: Fri May 03 2002 - 03:23:35 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    On 3 May 2002, Craig Sanders <castaz.net.au> wrote:
    > On Fri, May 03, 2002 at 12:06:21AM +0300, Liviu Daia wrote:
    > > for pval in $( mailq | sed -e '1d; $d; /^$/d; s/[* ].*$//' ); do
    >
    > that sed script matches the occasional line where the "(" in the
    > deferral messages like "(host fqdn.fqdn.fqdn[ip.ip.ip.ip] said: 452
    > Insufficient disk space)" is at the start of the line.
    >
    > try this instead:
    >
    > for pval in $( mailq | sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* ].*$//'); do
    >
    > craig

        Good point. Updated script below, with a new completion function
    for postalias and postmap. If no problems are found in a few days, I'll
    send a patch to the maintainer of the bash-completion package.

        Regards,

        Liviu Daia

    -- 
    Dr. Liviu Daia               e-mail:   Liviu.Daiaimar.ro
    Institute of Mathematics     web page: http://www.imar.ro/~daia
    of the Romanian Academy      PGP key:  http://www.imar.ro/~daia/daia.asc
    

    # Postfix postalias(1) and postmap(1) completion # _postmap () { local cur prev len idx

    cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}

    if [[ $cur == '-' ]]; then COMPREPLY=(-N -f -i -n -r -v -w -c -d -q) return 0 fi if [[ $prev == '-c' ]]; then COMPREPLY=( $( compgen -d -- "$cur" ) ) return 0 fi if [[ $prev == -[dq] ]]; then return 0 fi

    if [[ "$cur" == *:* ]]; then COMPREPLY=( $( compgen -f -- ${cur#*:} ) ) else len=${#cur} idx=0 for pval in $( postconf -m ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]="$pval:" idx=$[$idx+1] fi done if [[ $idx -eq 0 ]]; then COMPREPLY=( $( compgen -f -- "$cur" ) ) fi fi return 0 } complete -F _postmap postmap postalias

    # Postfix postconf(1) completion # _postconf () { local cur prev len idx

    cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} if [[ $cur == '-' ]]; then COMPREPLY=(-c -d -e -h -m -l -n -v) return 0 fi if [[ $prev == '-c' ]]; then COMPREPLY=( $( compgen -d -- "$cur" ) ) return 0 fi len=${#cur} idx=0 for pval in $( postconf | cut -d ' ' -f 1 ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$[$idx+1] fi done return 0 } complete -F _postconf postconf

    # Postfix postsuper(1) completion # _postsuper () { local cur prev len idx

    cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}

    if [[ $cur == '-' ]]; then COMPREPLY=(-d -p -r -s -v) return 0 fi if [[ $prev == -[dr] ]]; then len=${#cur} idx=0 for pval in $( mailq | \ sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* ].*$//' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$[$idx+1] fi done return 0 fi COMPREPLY=( $( compgen -d -- "$cur" ) ) return 0 } complete -F _postsuper postsuper

    - To unsubscribe, send mail to majordomopostfix.org with content (not subject): unsubscribe postfix-users