DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 18th October 2008
bsddaemon bsddaemon is offline
Slack Daemon
 
Join Date: Oct 2008
Posts: 35
Thanked 3 Times in 3 Posts
Default Exec command in zsh prompt?

Hi everyone. Im using laptop with FreeBSD. What Im trying to do is to display the remaining capacity and time in the shell prompt.

It is easily achieved with bash, but in zsh, the command is only executed upon startup.

This is a bash prompt in the .bashrc file. I use the date command as an example. The current time will be updated everytime you exec new command:

Code:
PS1='`date +'%H:%M:%S'` \!\[\e[1;31m\][\[$?]\[\e[37m\]\u@\h:\w\\$ '
This method doesnt work with zsh. If I put a similar command in .zshrc, it will show the current time on startup only, after that, the time is not updated at all.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nicer Prompt with ksh on 5.0 nihonto NetBSD Installation and Upgrading 8 12th October 2009 08:49 PM
backup freeBSD 7.0 using Backup Exec ccc FreeBSD General 2 25th April 2009 09:23 PM
changing custom prompt ksh for root. bsdnewbie999 OpenBSD General 7 1st April 2009 04:53 AM
init: can't exec getty after power failure mtx FreeBSD General 0 20th January 2009 10:14 AM
what to do at mountroot prompt? Sunsawe FreeBSD General 13 5th June 2008 08:06 AM


All times are GMT. The time now is 08:15 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick