anyone code bash shell scripts?
leave your contact info
thanks.
leave your contact info
thanks.



#!/usr/local/bin/php -q
<?php
// $argc contains the count of arguments passed
echo "Total argument passed are : $argc \n";
if ($argc) {
// $argv contains an array of the arguments that were passed
foreach($argv as $arg) {
echo $arg."\n";
}
}
?>
#!/usr/bin/perl -w
use strict;
use Frontier::Client;
my $apikey = 'APIKEYHERE';
my $src = 'sourcecode.phps';
my $title='test post';
my $code = '';
my $tags = 'tag1 tag2 tag3';
my $language = 'php';
my $flag = 0;
open(FC, "<:utf8", $src);
while (<FC>) {
if (/^\#[^!]\s*(.+)/ && $flag == 0) {
$title = $1;
$flag++;
}
elsif (/^\#[^!]\s*(.+)/ && $flag == 1) {
$tags = $1;
$flag++;
if (/(\w+) (.+)/) {
$language = $1;
$tags = $2;
}
}
$code = $code . $_;
}
my $session = Frontier::Client->new( url => 'http://snipplr.com/xml-rpc.php', debug => 0,);
my @args = ($apikey, $title, $code, $tags, $language);
my $result = $session->call('snippet.post', @args);
snipplr -c -meta ":title=>'test post',:tags=>'tag1 tag2 tag3',:language=> 'php'" < sourcode.phps


Comment