Fortune Telling Collection - Fortune-telling birth date - Linux operation, 8, design a shell program to calculate the factorial requirements of n: (1) receive the parameter n from the command line;

Linux operation, 8, design a shell program to calculate the factorial requirements of n: (1) receive the parameter n from the command line;

What if? [? -z? $ 1? ]; then what

Echo? You did not enter a parameter.

Quit 1

The ship does not bear the loading fee.

Case? $ 1? Are you online?

*[! 0-9]*)? Echo? The number you entered is illegal.

Quit 1; ;

*)? n = $ 1; ;

Environmental systems applications center environmental systems applications center

What if? [? $n? -Le? 0? ]; then what

Echo? You did not enter a positive integer.

Quit 1?

The ship does not bear the loading fee.

frac= 1

What time? [? $n? -gt? 0? ]

Do what?

frac=$((frac? *? n))

n=$((n? -? 1))

finished

Echo? The factorial is: $frac

Echo? Student number