Register to reply

Unix script problem

by Bimpo
Tags: script, unix
Share this thread:
Mar2-12, 08:26 AM
P: 10
1. The problem statement, all variables and given/known data

Trying to find how many numbers contains 5 between 1 to 4321

2. Relevant equations


3. The attempt at a solution

typeset -i current=1
typeset -i times=0
while [ $current -le 4321 ] ; do
if [ ] ; then <<<<<<<<<<< stuck here, not sure what to put in if, tried grep etc nonthing works yet
echo there are $times numbers that has a 5
Phys.Org News Partner Science news on
Mysterious source of ozone-depleting chemical baffles NASA
Water leads to chemical that gunks up biofuels production
How lizards regenerate their tails: Researchers discover genetic 'recipe'
Mar2-12, 08:42 AM
P: 10
nvm solved it just gonna add this for future people whos gonna look up this kind of problem in google

if [[ $current = *[5] ]] ; then

Register to reply

Related Discussions
Windows VS Unix Problem Programming & Computer Science 6
Search and Replace Unix Shell Script Programming & Computer Science 1
UNIX scp script Programming & Computer Science 3
Comsol Multiphysics/Script - Heat transfer problem General Engineering 0
Unix Shell Script Programming & Computer Science 3