hongy19’s blog

why we need single quote for awk


Today I need to use awk to add extra tabs and space to a long file. Then my first awk script begins.

awk is simple: /patter/’{action}’. You will see nearly every on-line introduction will tell you to add single quote to include actions. Sometimes single quote behavior is really strange in windows, but works well under Linux.

FinallyI realize single quote must be used to preserve bash to expand some special characters,like back-slash and stars, and pass them to awk. In Windows, dos/cmd has the different ways to do it, then you need different quote, see http://www.catonmat.net/blog/wp-content/uploads/2008/09/awk1line.txt for example.

Read more ⟶

Innovation


I am holding a whole day meeting to discuss about innovation. People talked a lot about it, but I am still not satisfied about it and have questions:

  • What actions do we have to archive our idea about innovation.
  • Do we really understand what innovation means?

I have some thinks about innovation. From my understanding, sometimes we misunderstand the difference between innovation/improvement/invention and others things. Innovation is a beautiful word, but what really does it mean?

Read more ⟶

Default action for SIGHUP


Q: Why program is killed if I log out the bash and why it survive if using nohup?

A: When log out, the bash will generate the SIGHUP to progress attached to it. If there is no default routine in progress to handle this signal, kernel will use the default action (terminate for SIGHUP). More information see section 10.2 of “Advanced Programming in the UNIX Environment” or http://www.win.tue.nl/~aeb/linux/lk/lk-10.html .

Read more ⟶