# Bash alias for the /usr/local/etc/rc.d/ folder



## SpaceCowMan (May 18, 2010)

I want to create an alias in bash so that instead of having to type:

/usr/local/etc/rc.d/mysql-server start

I can instead type:

rcd mysql-server start

Is that possible and what would the syntax look like?  I believe rc scripts need the full path every time to run otherwise I would have created a symlink to the folder in / already.

Thanks!


----------



## crsd (May 18, 2010)

service(8) was added to HEAD not so long ago - http://svn.freebsd.org/viewvc/base/head/usr.sbin/service/. I guess you could simply take the script and use it on your system (don't forget to check manpage for bash completion example).


----------



## JimW (May 18, 2010)

Probably a better way would be to create a short shell script to do the same thing. Give it a unique name (such as mysqlstart) and place the script in the /usr/local/sbin directory.

You could then accomplish what you wish just like typing a simple command.


----------



## SpaceCowMan (May 18, 2010)

Thanks!  the service(8) script is in 8-stable which i'm using!  Much appreciated!


----------

