Archive for 二月, 2016

tim cook & FBI



FBI居然会提出这么不合理的要求? 它是打算给apple经费嘛?做一个全新的OS,那不是小事,那是需要人和银子的。





trap of bash

trap is a command which is rarely used for most linux shell developers. But sometimes it is very useful, especially when u have some background jobs running and would like to cleanup such jobs if the scripts exits abnormally.

This page has an excellent explanation for trap command.

Besides it gives the difference between what “kill –SIGINT pid” does and CTRL+C, it is

  • the first applys to a process pid
  • the second applys to the forground job, all processes which belong to that job will receive SIGINT

Another tip is of using “& wait” make bash script asynchrous, so that  trap Command List can be executed immediately instead of only being run after the script’s  foreground process is complete.