sed -i '11 b; s/AllowOverride None\b/AllowOverride All/' test


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed -i '11 b; s/AllowOverride None\b/AllowOverride All/' test
# 1  
Old 08-27-2012
Java sed -i '11 b; s/AllowOverride None\b/AllowOverride All/' test

I searched everywhere and have had no luck. here is what I'm trying to do.
Code:
sed -i '11 b; s/AllowOverride None\b/AllowOverride All/' test

I have a single file I want to edit one line that appears 4 times. in this case line 11.
I want to change it from
AllowOverride None
to
AllowOverride All

and "test" at the end of my code is the file name

Thank you

Last edited by Franklin52; 08-28-2012 at 04:32 AM.. Reason: Please use code tags for data and code samples
# 2  
Old 08-28-2012
Try this...

Code:
sed '11 s/AllowOverride None/AllowOverride All/' file3

This User Gave Thanks to pamu For This Post:
# 3  
Old 08-28-2012
yes this worked great. Thank you
only change was to wright the file i had to add -i
Code:
sed -i '11 s/AllowOverride None/AllowOverride All/' file3


Last edited by Franklin52; 08-29-2012 at 04:13 AM.. Reason: Please use code tags for data and code samples
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shc : trying to test functionality "test" compiling but can not execute

I am testing shc to see if it would help with my need. Im at a point where Im trying to compile and test the "test.ksh" file that comes in the tar ball : shc-3.8.9> shc -v -r -f test.ksh shc shll=ksh shc =-c shc =exec '%s' "$@" shc = shc opts= shc: cc test.ksh.x.c -o test.ksh.x... (7 Replies)
Discussion started by: popeye
7 Replies

2. Shell Programming and Scripting

Prefixing test case methods with letter 'test'

Hi, I have a Python unit test cases source code file which contains more than a hundred test case methods. In that, some of the test case methods already have prefix 'test' where as some of them do not have. Now, I need to add the string 'test' (case-sensitive) as a prefix to those of the... (5 Replies)
Discussion started by: royalibrahim
5 Replies

3. Web Development

.htaccess Not Working With AllowOverride All

Source: Apache.org The .htaccess file is not read by the server based the test above and the lack of change in the operation of the server. httpd.conf <Directory /> Options None AllowOverride All # Initially this was set to None and I would prefer it be again, just testing ... (6 Replies)
Discussion started by: gnurob
6 Replies

4. UNIX for Dummies Questions & Answers

http to https Apache, AllowOverride All receives 403 err htaccess

Hi new to the forum, I have a Apache server on CentOS which hosts a web site. I've set up the SSL which has been tested as I can access my website via http and https. I would like to redirect all browsers to use https instead of http. I have created the htaccess file which contains 'Allow... (3 Replies)
Discussion started by: Sai245
3 Replies

5. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

6. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies
Login or Register to Ask a Question