$(( ( RANDOM % 10 ) + 1 ))
EDIT. Changed brackets into parenthesis according to the comment.
http://web.archive.org/web/20150206070451/http://islandlinux.org/howto/generate-random-numbers-bash-scripting
More Related Contents:
- Echo newline in Bash prints literal \n
- In the shell, what does ” 2>&1 ” mean?
- A variable modified inside a while loop is not remembered
- What is the difference between $(command) and `command` in shell programming?
- Passing parameters to a Bash function
- ssh breaks out of while-loop in bash [duplicate]
- Remove a fixed prefix/suffix from a string in Bash
- How to zero pad a sequence of integers in bash so that all have the same width?
- I just assigned a variable, but echo $variable shows something else
- Change the current directory from a Bash script
- Bash how do you capture stderr to a variable? [duplicate]
- Variable containing multiple args with quotes in Bash
- Should aliases go in .bashrc or .bash_profile? [duplicate]
- How to read user input into a variable in Bash?
- How to provide password to a command that prompts for one in bash?
- Deleting lines from one file which are in another file
- VSCode Change Default Terminal
- How to enter ssh password using bash? [duplicate]
- What is a unix command for deleting the first N characters of a line?
- How do I escape slashes and double and single quotes in sed?
- How to suppress variable substitution in bash heredocs
- Error message on Terminal launch [duplicate]
- Exit when one process in pipe fails
- How to split a file into equal parts, without breaking individual lines? [duplicate]
- Jenkins pipeline sh fail with “cannot run program nohup” on windows
- What does “<
- Comparing PHP version numbers using Bash?
- build argument lists containing whitespace
- Preserving leading white space while reading>>writing a file line by line in bash
- Loop over array, preventing wildcard expansion (*)