Friday, November 13, 2009

Shell Standard I/O

Q: What is the difference between these two shell statements?

$cmd >> $logFile 2>&1
$cmd 2>&1 >> $logFile

The first one is right and second one is wrong.

first one redirects any output from the $cmd to the $logFile. The second one just redirects the output and not the STDERR to the $logFile.


Sunday, November 01, 2009

Moral Dilemma

Q: How to decide if an action is morally right or wrong? E.g.
1. Taking a personal prinout using office printer?
2. Making a phone call using office phone ?
3. Stealing salad from the salad bar at office canteen?
4. Keeping the IPOD nano 4 GB found on a street at halloween pary on franklin street with urself?

Ans: If you can tell all your friends and family members about the action then the action should be morally right.
1. Should be OK.
2. Should be OK.
4. Dicey.