From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1036 invoked by alias); 7 Feb 2014 04:01:56 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18413 Received: (qmail 20483 invoked from network); 7 Feb 2014 04:01:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140206200141.ZM27955@torch.brasslantern.com> Date: Thu, 06 Feb 2014 20:01:41 -0800 In-reply-to: Comments: In reply to Thorsten Kampe "Executing command on reattaching to screen session" (Feb 6, 7:27pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Executing command on reattaching to screen session MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 6, 7:27pm, Thorsten Kampe wrote: } } Every time I login, /etc/motd is displayed. Since I hardly ever log } out and in, I'd like to have the same functionality when reattaching Perhaps a better way to do this is to put something in your precmd hooks so that the /etc/motd is shown when it has changed? E.g., latest_motd() { if [[ /etc/motd -nt ~/.last_motd ]] then cp --preserve=timestamps /etc/motd ~/.last_motd cat ~/.last_motd fi } add-zsh-hook precmd latest_motd