Write a shell script to find out the largest value from the given number of command-line arguments.
Special variables in bash:
$@- All arguments. $#- Number of arguments. $0- Filename. $1, $2, $3, $4 ... - Specific arguments.
- If the number of arguments is 0, end the program.
- If not zero, then
- Initialize a variable maxEle with first argument.
- Loop over all the arguments. Compare each argument with maxEle and update it if the argument is greater.
- Bash shell script to find sum of digits
- Bash shell script to swap two numbers
- Write a bash script to print a particular line from a file
- Leap Year Program with Bash Shell Scripting in Windows
- Introduction to Linux Shell and Shell Scripting
- Bash Script to get Low Battery Alert in Linux
- How to Fix Minimal BASH Like Line Editing is Supported GRUB Error In Linux?
- How to find time taken by a command/program on Linux Shell?
- Looping Statements | Shell Script
- Conditional Statements | Shell Script
- String Operators | Shell Script
- Implementing Directory Management using Shell Script
- Automated Recursive Encryption in a Directory Using Shell Script
- Difference Between Single and Double Quotes in Shell Script and Linux
- Bash program to find A to the power B
- Average of given numbers in Bash
- Bash program to check if the Number is a Prime or not
- Fibonacci Series in Bash
- Useful and time saving bash commands in Linux
- Bash program to check if the Number is a Palindrome
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.