Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

shell script loop while process running

#!/bin/bash
counter=$1
factorial=1
while [ $counter -gt 0 ]
do
   factorial=$(( $factorial * $counter ))
   counter=$(( $counter - 1 ))
done
echo $factorial
Source by www.cyberciti.biz #
 
PREVIOUS NEXT
Tagged: #shell #script #loop #process #running
ADD COMMENT
Topic
Name
8+2 =