Skip to main content

Shell script generate random number

$RANDOM can be used for generating random number in bash. $RANDOM generate an integer value. For example if you want to generate number as minutes, the command just like:

# echo $[ RANDOM % 60 ]


Popular posts from this blog

Find and replace with sed command in Linux

Find and replace feature is always handy. It can turn into a torture when it comes to change or delete a simple constant string in a text file. There is a handy tool in linux for doing these kind of tihngs. Actually sed is not a text editor but it is used outside of the text file to make changes.