File: convert.awk

package info (click to toggle)
phppgadmin 4.2.2-1lenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,156 kB
  • ctags: 5,642
  • sloc: php: 68,618; makefile: 214; sh: 40; sql: 16; awk: 9
file content (18 lines) | stat: -rwxr-xr-x 442 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/awk -f
#
# Script contains all needed conversions of recoded text
#
# Remove everything before first "<?php"
BEGIN	{ while (index($0,"&lt;?php")==0) { getline; continue } 
	  print "<?php";
	}
# Remove everything after first "?>"
# (as there should be only one occurance, thats no problem)
/\?\&gt;/ { print "?>"; exit }

	{ 
	  # Convert CRLF -> LF (== "remove CR" ) ;-)
	  gsub("&#13;","");
	  gsub("&apos;","'");
	  print $0
	}