Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PRINT_EXIT_VALUE: Suppress for if/while conditions



On Aug 19,  2:06am, Vincent Lefevre wrote:
} Subject: Re: PRINT_EXIT_VALUE: Suppress for if/while conditions
}
} > for i in file1 file2; do
} >   veryimportanttask $i
} > done
} 
} But you don't know which one:
} 
} $ for i in 1 2; do /bin/false $i; done
} zsh: exit 1     /bin/false $i
} zsh: exit 1     /bin/false $i

    eval "veryimportanttask ${(b)i}"

Of course then printexitvalue prints "exit 1" for each of the eval
as well.  *There* is a case where it's probably entirely extraneous.

torch% setopt printexitvalue
torch% for i in 1 2; do eval /bin/false $i; done
zsh: exit 1     /bin/false 1
zsh: exit 1
zsh: exit 1     /bin/false 2
zsh: exit 1



Messages sorted by: Reverse Date, Date, Thread, Author