Register
It is currently Wed Sep 02, 2015 10:51 pm

search, verify, add if not present


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Thu Aug 13, 2015 3:31 pm   

Joined: Thu Aug 13, 2015 3:25 pm
Posts: 2
Been trying to get the following one liner to work but keep getting an error:

echo "Backing up wp-config.php..."; cp -iv wp.config.php wp-config.php.$(date +%s).bak; echo "Checking WP Memory Limit configuration...”; grep -i "WP_MEMORY_LIMIT" wp-config.php || echo "define('WP_MEMORY_LIMIT','64M')" >> wp-config.php; grep 'WP_MEMORY_LIMIT' wp-config.php; echo;

Error produced:
syntax error near unexpected token `('

However, this portion of the script works perfectly in a vacuum:
grep -i "WP_MEMORY_LIMIT" wp-config.php || echo "define('WP_MEMORY_LIMIT','64M')" >> wp-config.php

Trying to understand where the syntax error is in this chain...


Top
 Profile  
 PostPosted: Thu Aug 13, 2015 4:07 pm   

Joined: Thu Aug 13, 2015 3:25 pm
Posts: 2
Figured it out. Can close thread now.


Top
 Profile  
 PostPosted: Thu Aug 13, 2015 4:37 pm   

Joined: Mon Oct 20, 2014 9:53 am
Posts: 191
Thanks for not letting other people know too.


Top
 Profile  
 PostPosted: Fri Aug 14, 2015 7:21 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 609
Quote:
configuration...


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP