From: Johannes S. <Joh...@gm...> - 2009-07-27 08:58:04
|
Hi, On Sun, 26 Jul 2009, leledumbo wrote: > > Try running this buggy script: > > for fin in `ls`; do > # notice the missing backtick (`) > fout=echo $fin | sed 's/\..*//' > done > > And (quickly) open task manager, you'll see a lot (and growing) of sh.exe > processes. This is really a PEBCAK: "fout=echo $fin" is a valid invocation of $fin with the environment variable "fout" set to the value "echo". I am pretty certain that your "ls" returns a couple of shell scripts, and they are executed. Now, why the number is growing, I can only guess that the forks are the issue (the sh.exe processes executing $fin not dying as quickly as the sed calls return), but that is pretty normal, given what you asked shell to do. Ciao, Dscho |