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
- Previous article:Korean variety fortune teller _ Korean variety fortune teller
- Next article:Celebrities who love fortune telling.
- Related articles
- Chuxiong industrial and commercial registration finance and tax dry goods, how to write the company name and business scope of the registered company?
- Why do some people say that Chinese medicine is pseudoscience?
- In 2023, on the first day of the first lunar month, Wei Zi told fortune.
- Science funny fortune-telling _ science funny fortune-telling video
- I would like to ask whether the fleeting time is stored in the couple's palace. If the fleeting time is limited to the same palace, the fleeting time will be transformed into a division of power, but
- Girlfriend's fortune telling. We can't.
- Giant door fortune teller _ giant door fortune teller
- Teach fortune-telling methods _ Teach fortune-telling methods to cheat.
- Whose poem is this?
- Dream of little sharks