On Fri, Jul 15, 2011 at 2:29 PM, Anupam Jain <ajn...@gmail.com> wrote: > Hi all, > > I originally posted this question on > stackoverflow<http://stackoverflow.com/questions/6624622/what-happens-in-bash-when-you-do-ctrl-c-hint-its-not-simply-sending-a-sigint>, > but did not receive a satisfactory response. Any ideas? > > --------------8<----------------- > > A little background first - When I do apt-get install downloads from my > company internet it provides a high burst of speed (400-500KB/s) for the > first 10 seconds or so before dropping down to a tenth of that (40-50KB/s), > and then after a few minutes to a truly miserable (4-5KB/s). This makes me > think that the sysadmin has implemented some sort of a network throttling > scheme. > > Now I know that the network is not simply erratic, because if I start > an apt-get > install foo, Ctrl-C it after 10 seconds and immediately run apt-get install > foo again (by doing an up arrow and enter to use bash history), and then *keep > repeating this process for a few minutes till all packages are downloaded*, > I can download even large packages very fast. In particular, even after > aborting a download with Ctrl-C, apt-get seems to be able to resume the > download in the next invocation. > > Of course, staring at the screen doing Ctrl-C Up Enter every 10 seconds gets > really boring real fast, so I wrote a shell script - > > #!/bin/sh > > for i in `seq 1 100` ; do > > > sudo apt-get install foo -y & > > > sleep 10 > > > sudo kill -2 $! > > done >
I guess the problem is because you are using apt-get, and is not suitable for scripting. use dpkg instead. that may solve your problem. -- GN _______________________________________________ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd