CFanatic

Go Back   CFanatic > Programming > Shell Scripting

Bashe "HERE documents " help topic posted under Shell Scripting which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2012, 08:43 PM
Junior Member
 
Join Date: Jun 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
woodson2 is on a distinguished road
| More
Bashe "HERE documents " help

I'm trying to enter a block of text into an existing configuration file for OpenLDAP so the setup can be fully scripted.

The text below is what I want to enter into slapd.conf and this all works well and good, however as you probably know this will place the text at the end of the file. What I'd like to know is how can I choose where in an existing file I want to place the text or is this beyond the scope of HERE documents?

Code:
cat >> slapd.conf << "EOF"
access to attrs=userPassword
        by self write
        by anonymous auth
        by dn.base="cn=root,dc=abclott,dc=lott" write
        by group.base="cn=infrastructure,ou=GTECH,ou=groups,dc=abclott,dc=lott" write
        by dn.base="uid=ldapmgr,ou=people,dc=abclott,dc=lott" write
        by * none

access to dn.children="ou=people,dc=abclott,dc=lott"
        by dn.base="cn=root,dc=abclott,dc=lott" write
        by dn.base="cn=bind,dc=abclott,dc=lott" read
        by users read
        by * none

access to dn.children="ou=groups,dc=abclott,dc=lott"
        by dn.base="cn=root,dc=abclott,dc=lott" write
        by dn.base="cn=bind,dc=abclott,dc=lott" read
        by users read
        by * none

access to dn.children="ou=servers,dc=abclott,dc=lott"
        by dn.base="cn=root,dc=abclott,dc=lott" write
        by group.base="cn=infrastructure,ou=GTECH,ou=groups,dc=abclott,dc=lott" write
        by dn.base="cn=bind,dc=abclott,dc=lott" read
        by users read
        by * none

access to dn.subtree="ou=SUDOers,dc=abclott,dc=lott"
        by dn.base="cn=root,dc=abclott,dc=lott" write
        by dn.base="cn=bind,dc=abclott,dc=lott" read
        by users read
        by * none

access to *
        by dn.base="cn=root,dc=abclott,dc=lott" write
        by dn.base="cn=bind,dc=abclott,dc=lott" search
        by * none
EOF
Reply With Quote
  #2  
Old 03-03-2012, 07:16 AM
Banned
 
Join Date: Feb 2011
Location: CA, USA
Posts: 38
Thanks: 0
Thanked 4 Times in 4 Posts
johnBMitchell is on a distinguished road
| More
Re: Bashe "HERE documents " help

You can search any file with select or search command and if you want to use that file then use access command. The given coding of access code is really good to understand file system.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help for a "binary search tree" C program boramaden C Programming 0 03-20-2011 06:23 AM
Is it a good practice to use "struct within union" for type polymorphism? clonebull C++ Programming 0 10-04-2010 11:11 PM
Unit Test Fails, throws COMException "There is no MTS object context" doglin82 C# Programming 0 09-01-2010 11:13 AM
Need a function 2 "PAUSE" and "RESUME" execution of a prg Ritesht93 C++ Programming 1 08-31-2010 03:46 AM
problem in make file "urgently need solution" Rajkamal2013 C Programming 0 08-28-2010 03:11 AM



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.