Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use utf8;
- $| = 1;
- binmode(STDOUT, ":utf8");
- binmode(STDIN, ":utf8");
- exit unless $ARGV[0];
- $pwd = `pwd`;
- chomp $pwd;
- my $command;
- if($ARGV[1]) {
- $command = shift @ARGV;
- }
- $pwd = $pwd . '/' . $ARGV[0];
- my $orig = $pwd;
- $pwd =~ s/(.*public_html\/)(.*)/$2/;
- if($command eq 'link') {
- utf8::decode($pwd);
- system(qq{echo 'http://$pwd' | xclip -i});
- } else {
- print $orig, "\n" unless $ARGV[1];
- utf8::decode($pwd);
- print "http://$pwd\n";
- }
Add Comment
Please, Sign In to add comment