Bash Scripting
NOTE : Bash scripts can be run using "bash <file_name.sh>"
- Command : sleep <time in seconds>
- This command is used to leave a small interval of time in seconds between the execution of the code.
- The command after sleep execute once the given time gets over.
- Using some Build in variable in bash:
- RANDOM
- This command is used to generate a random number.
- The range of the number lies from 0 to 32767.
- "$RANDOM" This command is used to produce the random variable.
- SHELL
- This command is used to display the current shell.
- Command : "$SHELL"
- PWD
- This command is used to display the current working directory.
- Command : "$PWD"
- HOSTNAME
- This command is used to diplay the host name.
- Which host is currently active.
- Command : "$HOSTNAME"
No comments:
Post a Comment