RaptorX wrote:
> Hi guys,
> 
> This is my first time building LFS 6.4, im in chapter 5.4.1 at the moment
> and I wanted to run the benchmark with the time command...

You have to understand how bash parses the command line.  It separates reserved 
words by whitespace and separates commands by semi-colons.

The reserved words are

! case  do done elif else esac fi for function if in select then until while { 
} 
time [[ ]]

Some of these are overloaded.  That is, there is a difference between { } and 
${xxx}, just like there is a difference between

'!12' and '! expression'

The syntax of time is basically:

time command

where command can be a compound command:

   { list; }
     list is simply executed in the current shell environment.
     list must be terminated with a newline or semicolon.
     This is known as  a  group  command.   The return status is the exit
     status of list.  Note that unlike the metacharacters
     ( and ), { and } are reserved words and must occur where a reserved
     word  is permitted  to  be recognized.  Since they do not cause a
     word break, they must be separated from list by whitespace.

So you can use:

   time { ls; ls -l; }

and it will work.

The sequence I use for the book is basically:

{ time \
   {
     echo Making $TITLE
     date

     ./configure --prefix=/usr &&
     make &&
     make DESTDIR=$DEST install

   }
} 2>&1 | tee -a $LOG

Note that the newlines can be replaced with semi-colons except the time command 
itself requires an argument, hence the escape at the first line.

Hope this helps.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to