403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.238
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/Tools/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/Tools/scripts/indent_make_if.pl
#!/usr/bin/env perl
# perltidy -bext=/ -i=8 -et=8 -l=132 -pt=2 -ce -cti=1

use strict;
use utf8;
use warnings;

my $extension = '.orig';
my $oldargv   = q{};
my $spaces    = 2;
my $indent;
my $argvout;

sub dotindent {
	my $amount = shift;
	return '.' . (' ' x ($spaces * $amount));
}

LINE: while (<>) {

	# For each file, save a .orig backup.
	if ($ARGV ne $oldargv) {
		my $backup;
		if ($extension !~ /[*]/) {
			$backup = $ARGV . $extension;
		} else {
			($backup = $extension) =~ s/[*]/$ARGV/g;
		}
		rename $ARGV, $backup;
		open $argvout, '>', $ARGV or die "Error for $ARGV: $!";
		$oldargv = $ARGV;
		$indent  = 0;
	}

	if (/^[.]\s*(?:if|for)/o) {    # if/for -> indent and increase indent
		s/^[.]\s*/dotindent($indent)/oe;
		$indent++;
	} elsif (/^[.]\s*end(?:if|for)/o) {    # endif/endfor -> decrease indent and indent
		$indent--;
		s/^[.]\s*/dotindent($indent)/oe;
	} elsif (/^[.]\s*(?:else|elif)/o) {    # else/elif -> indent one level down
		s/^[.]\s*/dotindent($indent-1)/oe;
	}
} continue {

	# Print the line.
	print {$argvout} $_;
}

Youez - 2016 - github.com/yon3zu
LinuXploit