Help in writing a script

Hey everyone
Can anyone please write me a script to display numbers in descending order dynamically i.e if the user enter a number say 100 then the output should be like 100 99 ....so on till 0
I tried using the logic as for ((i =1; i<=100; i--) but the it goes into a infinite loop since even the negative numbers are less than any given postive number entered by a user

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.

This isn't a homework problem iam new to Linux and shell scripting altogether and besides iam new to programming too i recently joined as an intern in QA department of voip company.If this still isnt the proper section to post it,Iam sorry and i will see that i wont repeat such mistakes in the near future
sorry again

for ((i=100;i>=0;i--));do echo $i;done

http://abs.traduc.org/abs-5.0-fr/ch10.html

Using "standard" linux "tools"

echo "Enter a number: "
read NUMBER
seq 0 ${NUMBER:-100} | tac

seq is not standard, though it is common; tac is not standard and is less common than seq.

But you don't need tac if you are using seq:

seq NUMBER -1 0

The standard way is:

read n
while [ $n -ge 0 ]
do
  printf "%d\n" "$n"
  n=$(( $n - 1 ))
done

In bash:

eval "printf '%d\n' {$NUMBER..0}"

I'm finding it increasingly difficult as I move from "proper UNIX" to linux to know what is standard.

There are just so many distributions of Linux about that all bets are off as to what versions of what anyone might have.

On AIX for example, "grep -p" is great for extracting stanzas (paragraphs) from files. But that's not standard I guess as GNU grep doesn't have it.

Add to that finds maxdepth, sed's in-place replacement... etc., etc.

Live and learn.

---
forgot to mention the worst one, echo -n (or echo minus anything)

The standards are available at Index of /onlinepubs/9699919799/utilities.

I use this bash function to look up the specs for a standard command:

sus()
{
    local dir=9699919799
    local localsusdir=/usr/share/sus/ ## adjust to taste
    html_file=$localsusdir/$1.html
    sus_dir=http://www.opengroup.org/onlinepubs/$dir/utilities/
    [ -f "/usr/share/sus/$1.html" ] || lynx -source $sus_dir${1##*/}.html > $html_file
    lynx -dump -nolist $html_file | ${PAGER:-less}
}

Invoke as, e.g.:

sus find