Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used PHP array

$lang['module']['1'] = 'Title';
$lang['module']['2'] = 'Title2';
$lang['value'] = 'text123';

how i can use replace in terminal Key Value to CASE UPPER ?

etc .. recursion

find /var/www/site.net/blog/ -iname '*.php' | xargs grep -E '\$lang\[' -sl

finded only $lang[ ...

Please help me.

share|improve this question

closed as off topic by Ulrich Dangel, Mat, Stéphane Gimenez, Renan, jw013 Aug 31 '12 at 20:15

Questions on Unix & Linux Stack Exchange are expected to relate to Unix or Linux within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Should 1 and 2 also be changed? Eg., can text appear there? – lynxlynxlynx Jul 2 '12 at 22:01
find /var/www/site.net/blog/ -iname '*.php' -exec grep -l "\$lang\['" {} \; \
-exec sed -i.bak "s/$lang\['\([^']*\)']/$lang['\U\1']/" {} \;

-i option is used with .bak to make backup file with .bak extension on the each file sed will change. It is useful in case there is type in sed and you will not loose all your data. In case you're sure everything is ok, you can use just -i. In this case it won't make a backup.

share|improve this answer
Let's hope he has GNU sed for the \U. – lynxlynxlynx Jul 2 '12 at 22:08
find /var/www/site.net/blog/ -iname '*.php' -exec sed -E "s/$lang\['\([^']*\)']/$lang['\U\1']/" {} \; is not work – DevZone Jul 3 '12 at 4:38
my php array dinamic $lang['VALUE'] $lang['l1']['l2']['l3'] etc.. – DevZone Jul 3 '12 at 4:39
What's wrong? Are there any errors? Can you show them? – rush Jul 3 '12 at 7:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.