LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating mult command alias in BASH (https://www.linuxquestions.org/questions/linux-newbie-8/creating-mult-command-alias-in-bash-256620/)

labob 11-18-2004 07:22 PM

Creating mult command alias in BASH
 
Hello. Two part question if I may.

1) If I create a .bashrc alias that has more than one command, thus separated by a semi colon, do I put a quote mark around each command, or just the full alias string? For instance:
Code:

alias test='comand number one' ; 'command number two'
or
alias test='command number one ; command number two'

2) If I create a multi command alias and one of the commands results in a prompt for input (such as password) that suspends activity, will the remaining commands in the alias carry out after the prompt is responded to, etc.? I'm thinking of creating a backup routine that first dumps the mysql database, then tars certain directories, but the database dump will prompt me for my mysql password and is why I was wondering if the remaining commands will wait for me to respond to that prompt?

TIA

Steel_J 11-18-2004 07:37 PM

I can only answer question 1) and it's a quote around each command.


All times are GMT -5. The time now is 12:30 PM.