Drush allows for commands to have options. I typically run commands such as:
drush dl views views_ui -y; drush en views views_ui --yes;
This will download and install the Views module.
Some Drush commands enforce (but all support) something called Strict Option Handling.
This allows the Drush options for a command to be unambiguously used by Drush and pass on additional options to sub commands in your shell script.
You may find for example this command — doesn’t do what you want (bypass confirmation with -y):
drush rsync @development:sites/all/themes @production:sites/all/themes -y
By default the Drush rysnc command and Drush ssh command use strict option handling — due to how the sub commands make use of additional arguments in Bash (such as –exclude for Rsync).
A nice reference for Drush commands I recently stumbled upon is DrushCommands. I find its layout and usage efficient to use.
The structure for Drush commands using strict option handling would be:
drush [global options] command [command options]
This will pass [global options] to Drush and [command options] to shell commands.
It’s a good habit to place -y and other global options right after you type Drush. So oddball commands like Rsync and SSH don’t trip you up when using Drush and you try to pass options to them.
Rewriting the above commands we would get:
drush -y dl views; drush -y en views views_ui;