Re: slab consumption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2007-10-16 at 15:01 +0700, Mulyadi Santosa wrote:
> Hi...
> > [1] test script
> > #!/bin/sh
> >
> > [ ! -d /mnt/memtest ] && mkdir -p /mnt/memtest
> > while [ 1 ]; do
> >     /sbin/ifconfig irda0 down
> >     sleep 1
> >     /sbin/ifconfig irda0 up
> >     sleep 1
> I roughly think it because the shell fork new subshell in every "while" 
> iteration. What if you do it like this instead:
> while [ 1 ]; 
> do (
> ...your commands..
> 
> ; ) ;
> done
> 
> 
> That way, all commands will be executed under the same shell, not 
> forking one continously.
> 

A () compound will still be executed in a subshell.. {} will execute in the current shell:

while [ 1 ];
do {

command;
command;

}; 
done


-law



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux