13 September 2012

BASH SCRIPTING


CREATE INFINITE WHILE LOOP WITH EMPTY EXPRESSION
==================================================

#!/bin/bash

while :
do
echo "infinite loops [ hit CTRL+C to stop]"
done

OR

#!/bin/bash
chekpt=5

while [ "$chekpt" -lt 6 ]
do

echo "infinite loops [ hit CTRL+C to stop]"

done


CREATE A FILE WITH PRESENT DATE -TIMEGROUP
============================================
 
#!/bin/bash

filename=`/bin/date +%d%m%y%H%M%S`

/bin/touch /tmp/$filename
 

No comments:

Post a Comment