Reddy4U-Solaris
asked on
Script Needed Urgent
simple script in a scripting language that prints the numbers from 1 to 100. But for multiples of three print "Site" instead of the number and for the multiples of five print "Host". For numbers which are multiples of both three and five print "SiteHost".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent Response
That's PERL.
Thanks.
Thanks.
bash version is virtually the same
#!/bin/bash
for i in $(seq 1 100)
do
if [ $(($i%15)) -eq 0 ]
then
echo SiteHost
elif [ $(($i%3)) -eq 0 ]
then
echo Site
elif [ $(($i%5)) -eq 0 ]
then
echo Host
else
echo $i
fi
don
e
ASKER