Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, lets say below is file content Order deny,allow Deny from all AuthName "htaccess password prompt" AuthUserFile /home/askapache.com/.htpasswd AuthType Basic Require valid-user Allow from 172.17.10.1 Satisfy Any i want add ...
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    5

    how to add line next to searched syntax

    Hi,

    lets say below is file content


    Order deny,allow
    Deny from all
    AuthName "htaccess password prompt"
    AuthUserFile /home/askapache.com/.htpasswd
    AuthType Basic
    Require valid-user
    Allow from 172.17.10.1
    Satisfy Any

    i want add new line lets say "Allow from 192.168.0.1" after allow from line by using bash script.

    Thank's in advance

  2. #2
    Just Joined!
    Join Date
    Feb 2007
    Posts
    5
    Quote Originally Posted by jagnikam View Post
    Hi,

    lets say below is file content


    Order deny,allow
    Deny from all
    AuthName "htaccess password prompt"
    AuthUserFile /home/askapache.com/.htpasswd
    AuthType Basic
    Require valid-user
    Allow from 172.17.10.1
    Satisfy Any

    i want add new line lets say "Allow from 192.168.0.1" after allow from line by using bash script.

    Thank's in advance
    Got it

    sed '/Searchstring/ a\
    new line string' file1

    i was using i instead of a ..... thats where the problem is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...