So, I was trying to run mysql on my computer at home to do some rails 
stuff (just playing around, and moving a CS 360 project to my computer 
so I could see it at home - I'm running OSX 10.5, if that's important), 
and it works fine, but to start the daemon the installation is requiring 
that I be in the directory with the mysql bin/ folder.  I thought that 
was kind of annoying, so I decided to make an alias in my .bashrc to 
change directories, start the process, then change back.  Probably an 
easier way to do it would be to put in the alias all of the options that 
make it so I don't have to do the change directories business, but I'm 
not sure what all of those options are.  Anyway, this was the alias that 
I put in .bashrc:
alias 'mysql-start'='cd ~/Documents/mysql-5.0.51b-osx10.5-x86; 
bin/mysqld_safe --defaults-file=my.cnf &; cd ~-'
Now, you would think that would work fine (at least I did), but 
apparently bash doesn't like the ampersand along with semicolons, 
because it wouldn't let me do it until I took out the ampersand.  But 
that's annoying, because then if I suspend the process and put it to the 
background, it's still tied to that specifc terminal, and I would prefer 
to not have to suspend it and put it into the background myself. 

Actually, in the process of writing this I thought of a better solution 
- I put a symbolic link to my installation directory where mysql was 
expecting the mysql folder to be.  That fixed the whole problem, and I 
don't have to cd anymore in the alias, and I don't need the semicolons, 
so the ampersand works.  But I'm still sending this because I'm curious 
about why the ampersand and the semicolon aren't friends.  Is there a 
way to get around this and still run processes in the background if you 
want to enter a one line, multi-statement command?

Matt Gardner
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to