control user within shell script
If our script must be launched with witr user :
if [ $USER != witr ] ; then echo "must connect as witr" ; exit ; fi
if [ $USER != witr ] ; then echo "must connect as witr" ; exit ; fi
get last 10 log of several svn projects with shell comand line :
ls -1 | while read proj; do echo "============$proj"; svn log -l 10 $proj; done
Ex1. calculate (10-7+500)*(4 power 3 )-square root of(900)
irb(main):001:0> (10-7+500)*(4**3)-Math.sqrt(900)
=> 32162.0
Ex2. get exact date at 14 days before now (in seconds 14x24x60x60 before now)
irb(main):002:0> Time.new – (14*24*60*60)
=> Thu Nov 21 15:52:53 +0100 2013