On Thu, 10 Jun 2004 21:57:20 +0200
Kaj Haulrich <[EMAIL PROTECTED]> wrote:

> On Thursday 10 June 2004 21:13, H.J.Bathoorn wrote:
> > On Thursday 10 June 2004 10:14, [EMAIL PROTECTED] wrote:
> > > is it possible to create (save ) automatic files ( like batch
> > > files in Windows) in Linux ? How ?
> > >
> > > I want to use this not to do always the same things in console.
> >
> > yes, you can put the commands you want automated in a text file.
> > If there's a sequence of commands give each command it's own
> > line.
> >
> > Run the file thus: "source name_of_file.txt" ........without the
> > quotes and they'll get run.
> >
> > Good luck,
> > HarM
> 
> Just to show off as a wise guy  :
> 
> I don't think you can "run" a text file just like that. But you can 
> create a small script, as follows :
Oh yes you can, at least under tcsh at the console.  And the text file does 
not need executable permissions.  Not to be recommended as a general method
though.

HarM's advice is sound.

> In a text editor, type :
> 
> #! /bin/bash
> first command here
> second command here
> third command here
> .
> .
> last command here
> exit
> 
> As a very useful example : 
> 
> #! /bin/bash
> rpm --rebuilddb
> updatedb
> urpmi.update -a
> ldconfig -v
> update-menus -v
> exit
> 
> 
> When finished entering commands, save the file with some descriptive 
> name, like - as in the above example -  "updateall".  Then, go back 
> to the command prompt, and make this file executable. In the above 
> example the commands need to be run as root, so in order to make it 
> executable by root, first become root and then :
> 
> chmod 777 updateall
> 
> which will give unlimited access to the file (which doesn't matter 
> here).
> 
> Now, you can run the file. If it is not in your path, just cd to the 
> directory containing the file and type : 
> 
> ./updateall
> 
> That's all.
> 
> HTH
> 
> Kaj Haulrich. 
> -- 
> * Sent from a 100 % Microsoft-free computer *
>        * http://www.haulrich.net *
> * running Linux kernel 2.6.4 on Mandrake 10.0 *
> 
> 
-- 
Len Lawrence
----------------------------------------------------------
The two things that can get you into trouble quicker than anything else
are fast women and slow horses.
----------------------------------------------------------

____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to