Koozali.org: home of the SME Server

command to append text in /etc/modules.conf

Rob Wellesley

command to append text in /etc/modules.conf
« 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

Ray Mitchell

Re: command to append text in /etc/modules.conf
« Reply #1 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

Rob Wellesley

Re: command to append text in /etc/modules.conf
« Reply #2 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

chris meredith

Re: command to append text in /etc/modules.conf
« Reply #3 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

Rob Wellesley

Re: command to append text in /etc/modules.conf
« Reply #4 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

Les Mikesell

Re: command to append text in /etc/modules.conf
« Reply #5 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.

Rob Wellesley

Re: command to append text in /etc/modules.conf
« Reply #6 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