any developers code shell scripts?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fris
    I have to go potty
    • Aug 2002
    • 55752

    #1

    any developers code shell scripts?

    anyone code bash shell scripts?

    leave your contact info

    thanks.
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


    Totally Free Templates
  • PowerCum
    CjOverkill
    • Apr 2003
    • 1328

    #2
    Usually people would say "See sig"

    In this case I can only say... Look at YOUR sig
    CjOverkill Traffic Trading Script
    Free, secure and fast traffic trading script. Get your copy now

    Comment

    • fris
      I have to go potty
      • Aug 2002
      • 55752

      #3
      ya, they dont do shell scripting, or else i wouldnt have made the post
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


      Totally Free Templates

      Comment

      • PowerCum
        CjOverkill
        • Apr 2003
        • 1328

        #4
        Search round on freshmeat and sourceforge.
        Unless you need something really complex it's probably done already.

        Image resizing, movies pics extraction and so on... there are like 500 scripts that do these tasks.
        CjOverkill Traffic Trading Script
        Free, secure and fast traffic trading script. Get your copy now

        Comment

        • fris
          I have to go potty
          • Aug 2002
          • 55752

          #5
          Originally posted by PowerCum
          Search round on freshmeat and sourceforge.
          Unless you need something really complex it's probably done already.

          Image resizing, movies pics extraction and so on... there are like 500 scripts that do these tasks.
          need something custom, but not complex.

          its for posting to a source code site from the command line.

          one of the parameters is tags:

          tag1,tag2,tag3

          not sure how to parse that in a shell script
          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


          Totally Free Templates

          Comment

          • nation-x
            Confirmed User
            • Mar 2004
            • 5370

            #6
            why does it need to be a "bash" shell script? You can run perl, php, etc from the shell.

            http://www.phpbuilder.com/columns/darrell20000319.php3
            Last edited by nation-x; 02-17-2009, 08:13 AM. Reason: added link

            Comment

            • mrkris
              Confirmed User
              • May 2005
              • 2737

              #7
              Originally posted by nation-x
              why does it need to be a "bash" shell script? You can run perl, php, etc from the shell.
              My thoughts exactly.

              PHP-MySQL-Rails | ICQ: 342500546

              Comment

              • nation-x
                Confirmed User
                • Mar 2004
                • 5370

                #8
                Code:
                #!/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";
                	}
                }
                ?>

                Comment

                • nation-x
                  Confirmed User
                  • Mar 2004
                  • 5370

                  #9
                  Originally posted by PowerCum
                  Usually people would say "See sig"

                  In this case I can only say... Look at YOUR sig
                  stfu... real webmasters are posting... not thieving bitches

                  Comment

                  • fuzebox
                    making it rain
                    • Oct 2003
                    • 22356

                    #10
                    Generally for command line stuff I just do it in perl.

                    Comment

                    • tranza
                      ICQ: 197-556-237
                      • Jun 2003
                      • 57559

                      #11
                      Originally posted by nation-x
                      Code:
                      #!/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";
                      	}
                      }
                      ?>
                      Thanks for this bro! ;)
                      I'm just a newbie.

                      Comment

                      • doridori
                        So Fucking Banned
                        • Jul 2008
                        • 2222

                        #12
                        see see sig

                        Comment

                        • nation-x
                          Confirmed User
                          • Mar 2004
                          • 5370

                          #13
                          Originally posted by tranza
                          Thanks for this bro! ;)
                          np..

                          doridori - go eat a sick dick punk

                          Comment

                          • fris
                            I have to go potty
                            • Aug 2002
                            • 55752

                            #14
                            this basically does what i want it to do, but in perl

                            Code:
                            #!/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);
                            the command line version of it using the snipplr ruby gem would be

                            Code:
                            snipplr -c -meta ":title=>'test post',:tags=>'tag1 tag2 tag3',:language=> 'php'" < sourcode.phps
                            Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


                            Totally Free Templates

                            Comment

                            • k0nr4d
                              Confirmed User
                              • Aug 2006
                              • 9231

                              #15
                              It sounds to me like the 'curl' command line does exactly what you are after...
                              http://curl.haxx.se/docs/manpage.html

                              ...or i might have misread completely.
                              Mechanical Bunny Media
                              Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

                              Comment

                              • nation-x
                                Confirmed User
                                • Mar 2004
                                • 5370

                                #16
                                hehe... today is the first time I ever looked at snipplr... how funny

                                Comment

                                Working...