On Tue, 13 Apr 2010 21:03:50 -0500 "David C. Rankin" <drankinatty@suddenlinkmail.com> wrote:
On 04/13/2010 02:58 PM, Flavio Costa wrote:
What about that: for i in $(ls -1 /etc/rc.d); do alias rc-$i="/etc/rc,d/$i"; done That's simple and dynamic, just insert it on your .bashrc ou /etc/bash.bashrc (global)
Yes,
But that leaves me updating multiple .bashrc files (root, david, testacct1, etc..) on each box. If you just symlink them, they are there for all -- no editing involved.
You could put it in /etc/bash.bashrc On Tue, 13 Apr 2010 17:11:17 -0300 Denis A. AltoƩ Falqueto <denisfalqueto@gmail.com> wrote:
On Tue, Apr 13, 2010 at 4:58 PM, Flavio Costa <flavio.cdc@gmail.com> wrote:
What about that: for i in $(ls -1 /etc/rc.d); do alias rc-$i="/etc/rc,d/$i"; done That's simple and dynamic, just insert it on your .bashrc ou /etc/bash.bashrc (global)
That has a problem. It is evaluated when you log in (or when you source .bashrc explicitly). But if you keep a session long enough and install a package with a file in /etc/rc.d, you will not have a corresponding alias rc-<new service>.
you could easily reinvoke the script manually, or with a wrapper function around pacman. On Wed, 14 Apr 2010 07:52:44 +0200 Linas <linas_fi@ymail.com> wrote:
Seems my message didn't get through.
It was just doing rc() { /etc/rc.d/$*; }
And to get completion, complete -o filenames -W "$(cd /etc/rc.d/ && echo *)" rc
That requires a relogin / sourcing the profile again to update the completion (could be avoided with another function) but it's neat and simple.
very nice. can you make the completion dynamic? that would make it awesome. Dieter