Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.questions Subject: Re: Timing Pipelines Message-ID: <977@philmds.UUCP> Date: 16 Mar 89 12:09:07 GMT References: <3680044@eecs.nwu.edu> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 23 In article <3680044@eecs.nwu.edu> naim@eecs.nwu.edu (Naim Abdullah) writes: |How can one time a pipeline in the csh/sh so that the time returned |is that of the longest running process in the pipeline ? | |So, for example running it on "ls | sleep 5" should return 5 seconds |assuming that the ls finishes before then. | |A sample solution would be | |% time sh -c "ls | sleep 5" | |but that involves creating an extra process. Is there a clever |quoting trick that would avoid the extra process ? I would expect that % time eval 'ls|sleep 5' would perform your trick, but strange enough ls and sleep are executed one after another (parallel? at least no pipe). What is this, another csh bug (without 'time' the problem remains) ? Leo.