bash - How to get $this->translate('Content') => Content in a Textfile -


I am having a shell script which scans all my subdirectories for a direcotry and .php and .phtml files. Within these files, I am looking for the $ -> translation (') statement (also $ -> view-> translation (' ')) and I want to save the content of these statements in a text file.

The problem is, there are many different types of this statement:

I have already programmed a script and a man M starmind.com sent me the following lines:

  Echo -n & gt; `Find me at give_me_your_favorite_file_name.txt for I. -Name '* php' `do echo -n 'processing $ i ..." # "$ i ++++++++" echo "++++++"> Give_me_your_favorite_outfile_name Translations of txt cat $ i | SED -n -e '/ - & gt; (* / p' | .sed -e's /\(.*-& gt;) (\) \ ([az AZ \ d092 \ D039 \ d034] * \) \ (. *) / \ 2 / g '| sed -e' s / \ (. * \) \ (\ D039 \) / \ 1 / g '| sed -e' / / (. * \) \ (\ D034 \) / \ 1 / g '> gt; give_me_your_favorite_outfile_name.txt resonates in "seems" done for "I did -iname' * phtml '` -n The echo is "processing $ i ..." # echo "+++++++ $ i +++++++" from> gt; give_me_your_favorite_outfile_name.txt cat $ i | sed -n -e Translation of '/ -' (* / p '| sed -e's /\(.*-& gt; (. \) (. * \) Translation \ ([az AZ \ d (0) Unfortunately, it does not include all the above mentioned cases, especially quotes within quotes, as I am not a shell expert, and for this I am not a shell specialist. Script requires the verification process, I would be very happy to get help from you people.  

Important: It should be written in Shell. A PHP version exists

  find / path-type f \ (-name "* .php" -o - Name "* .phtml" \) | While IFS = read -r -d $ '\ 0' read while filing -r line '$$' - '$ line'; Translate '* | * '$ This-> View- & gt; Translation '*) line = "$ {line # * this * translation ()" line = "$ {row %%} *}" case $ {line: 0: 1} in \ $) s = $ {line: 0 } ;; *) S = $ {line: 1: $ {# line} -2} ;; In the ASAC case, "$ s" * [\ "\ '], *) s = $ {s / \\ /} echo $ {s %% [\" \'], *} ;; *) "$ S" echo ;; ASAC ASAC did & lt; "$ File" done  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -