[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Automated commands



>       This may sound a bit stupid but I am looking for a way 
> to automate certain functions I do. 

There are no stupid questions.  Not that this didn't 
give me a giggle....

> lets say I wanna automate this function and probably others
> 
> /usr/bin/makemap hash /etc/virtusertable < /etc/virtusertable

Launch a text editor and paste in the text between
START and END.

=-=-=-=-=-=-=-=-=-=-=-START=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#!/bin/sh
#
# Hash virtusertable
#
/usr/bin/makemap hash /etc/virtusertable < /etc/virtusertable 
=-=-=-=-=-=-=-=-=-=-=-=END-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
and then save the file as, say /usr/bin/makemehash.

Somebody else can tell you where it should go exactly.

> So lets say I am at the command prompt and I just type 
> makemehash it then

You'll need to change the permissions to make it executable;
chmod u+x makemehash should do the trick.

NB compared to the DOS world that the current directory is *not* 
in the path.  If you have the executable in your current directory
you'll need to type ./makemehash.

Look in, say /etc/rc.d/rc3.d (on the Qube at any rate) to look
at lots and lots of very important scripts.

Next week - Mysteries Of Crontab, or, How To Make It Happen 
In Your Sleep.