jeudi 19 mars 2015

Shell print numbers that are smaller than first number

I'm trying to print the numbers that are smaller than first number



./8d 100 5 8 6


so my result should be 5 8 6



#!/bin/bash
for i in $*
do
if [[ $1 > $i ]]; then
echo "Num " $i
fi
done


But I dont get any result. What I'm doing wrong?


Aucun commentaire:

Enregistrer un commentaire