Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Rob Wellesley on August 31, 2002, 03:09:46 PM

Title: command to append text in /etc/modules.conf
Post by: Rob Wellesley on August 31, 2002, 03:09:46 PM
Hi

I am writing a script to setup cdwriters(ing) and can't remember how to get lines inserted in files from the commandline

anyone??


thanks
Title: Re: command to append text in /etc/modules.conf
Post by: Ray Mitchell on August 31, 2002, 09:29:58 PM
Try
pico /etc/modules.conf
But rather than editing config files directly you should in many cases use custom templates. See the article on e-smith.org
http://www.e-smith.org/docs/papers/templates.html

I'm still learning and don't yet know which files should have custom templates or not, but it will tell you in the top of the file ie not to edit this file directly

Also see
http://www.linux.org/docs/index.html

Hope this helps
Ray Mitchell
Title: Re: command to append text in /etc/modules.conf
Post by: Rob Wellesley on September 01, 2002, 04:20:25 AM
thanks for your response but I am looking for something I can use in a script that will -

#

the reason is that /etc/modules.conf, while templated, is "different". additions are put right in the file not in the template

/etc/e-smith/templates/path_to_template  wil show you which conf files are templated


ta
Title: Re: command to append text in /etc/modules.conf
Post by: chris meredith on September 01, 2002, 06:19:36 AM
echo text >>filename

Put your text in quotes if there are spaces.  You might have to escape certain characters as well.

>> appends
> overwrites
Title: Re: command to append text in /etc/modules.conf
Post by: Rob Wellesley on September 01, 2002, 03:25:42 PM
chris meredith wrote:
>
> echo text >>filename
>

thanks Chris, just the ticket!!

But - where is the manpage for     >>    :-)

(yes - I 'm kidding)

rob
Title: Re: command to append text in /etc/modules.conf
Post by: Les Mikesell on September 05, 2002, 04:00:53 AM
For others who might not know,  the >,>>,&,|,&&,||, etc. are actually shell metacharacters, and the default Linux shell is bash.  So, 'man bash' is the right place to look.
Title: Re: command to append text in /etc/modules.conf
Post by: Rob Wellesley on September 06, 2002, 02:17:41 AM
Les Mikesell wrote:
>
> For others who might not know,  the >,>>,&,|,&&,||, etc. are
> actually shell metacharacters, and the default Linux shell is
> bash.  So, 'man bash' is the right place to look.

Of course!!  - Excellent!

Thanks Les