Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 114744 - tcsh: builtin time variable not respected
Summary: tcsh: builtin time variable not respected
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-07 06:21 UTC by kalium
Modified: 2009-01-15 20:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kalium 2005-12-07 06:21:34 UTC
set time='3 %M'
should tell the tcsh-builtin time command to display another set of time/memory
resource usage variables. That does not work.



 tcsh --version
tcsh 6.13.00 (Astron) 2004-05-19 (i386-intel-linux) options
8b,nls,dl,al,kan,rh,color,dspm,filec






emerge --info
Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2,
2.6.14.3 i686)
=================================================================
System uname: 2.6.14.3 i686 Intel(R) Pentium(R) M processor 1400MHz
Gentoo Base System version 1.6.13
distcc[23519] (dcc_trace_version) distcc 2.18.3 i686-pc-linux-gnu; built Oct  8
2005 00:19:36 [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo/
http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://ibiblio.org/pub/Linux/distributions/gentoo"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/mark/div/portage/dev /home/mark/div/portage/wiki"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3ds X aac aalib acpi ada adns alsa apache2 apm arts audiofile avi
berkdb bitmap-fonts blas bonobo bzip2 calendar cdr cjk crypt cups curl directfb
divx4linux dts edl eds emacs emboss encode epiphany esd ethereal exif expat f2c
fam ffmpeg flac foomaticdb fortran gcj gd gdbm ggi gif glut gmp gnome gnutls
gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile haskell icq icu idn imagemagick
imlib ipv6 irda jack java jpeg junit kde kerberos kqemu lcms ldap libg++ libwww
lirc live logrotate lua lzo mad matroska mhash mikmod ming mmx mng mono motif
mozcalendar mozilla mozsvg mp3 mpeg music mysql nas ncurses network nls ogg
oggvorbis openal opengl oss pam pascal pcre pdf pdflib perl pic plotutils png
postgres python qt quicktime readline recode rtc ruby samba scanner sdl session
shorten slang slp sms sndfile softmmu speex spell sqlite sse sse2 ssl svg svga
tcltk tcpd tetex theora tidy tiff timidity truetype truetype-fonts type1-fonts
udev unicode usb userlocales v4l2 vhosts vorbis wifi win32codecs wmf wxwindows
xanim xine xinerama xml xml2 xmms xosd xprint xv xvid zlib video_cards_radeon
video_cards_nvidia linguas_de userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Fabian Groffen gentoo-dev 2005-12-07 07:20:23 UTC
not sure.  I tested what you give on tcsh 6.14 in portage, and on Fedora Core. 
Both don't seem to do anything with the time variable.  6.11 on Debian (I guess
that version is 'stable') doesn't also respect this variable.

Do you know a system/setting where it does work?
Comment 2 Fabian Groffen gentoo-dev 2005-12-29 12:50:25 UTC
it's unknown if this should work.
Comment 3 Francois L'Archeveque 2009-01-15 20:24:38 UTC
(In reply to comment #2)
> it's unknown if this should work.
> 
To set a variable in tcsh with multiple words, the syntax is:

set time = ( 3 %M )

or if the second word (which is the format for the time command) has a space:

set time = ( 3 '%M %E' )

"If set to a  number, then the time builtin (q.v.) executes automatically after each command which takes more than that many CPU seconds.  If there is a second word, it is used as a format string for the output of the time builtin."

For a program to use more than 3 CPU seconds (not wall clock runtime) as your time variable requests, it has to do some serious number crunching:

#include <iostream>
#include <math.h>

int main()
{
   for(long i = 0L ; i < 1e9 ; ++i)
   {
      double x = sqrt(2.0);
      if ( i % 1000 == 0 )
         std::cout << i << " " << x << std::endl;
   }
   return 0;
}

If it does take more than 3 seconds and you set the time variable with the proper syntax you should see an extra line of output in the shell when the program terminates.