Results 1 to 6 of 6
  1. #1
    Braaaaiiiins Zombie's Avatar
    Status
    Zombie is offline
    Join Date
    Oct 2010
    Posts
    2,545
    Post Thanks / Like
    Calm like a bomb.
     



    Official Useful Shell Scripts Thread

    Introducing the Official Useful Shell Scripts Thread.

    When submitting useful shell scripts, please use this format:
    PHP Code:
    Simple Name"a simple name for easy finding"
    Quick Description"a quick description describing the function and purpose of your script"
    [code]
    #!/bin/bash
    insert
        your code
    done
    [/code]
    howtodescribe how to use/modify your script 
    Output:
    Simple Name: ie "rename images"
    Quick Description: "change image names to incremental four number list"
    Code:
    #!/bin/bash
    a=1
    for i in *.jpg; do
      new=$(printf "%04d.jpg" ${a})
      mv "${i}" "${new}"
      let a=a+1
    done
    howto edit: Shouldn't take much to look at the above code to realize that if your images are .png's to change the *.jpg to .png (obviously you see another .jpg, if you'll want to change that too to or else your .pngs will be turned into .jpgs! and you'll also want to edit the %04d to change the amount of numbers created while naming.

    Remember to always submit clean code and to run your shell check.
     
         
    Last edited by Zombie; 01-29-2013 at 05:52 PM.

  2. #2
    Senior Member -Frost Knight-'s Avatar
    Status
    -Frost Knight- is offline
    Gender
    Join Date
    Feb 2012
    Location
    The guy on the roof....with a sniper on my hand saying:Hi
    Posts
    2,017
    Post Thanks / Like
    O_O So can you stop stalking
    me now?
     

    Re: Official Useful Shell Scripts Thread

    Wait....what is shell scripts
     
         

  3. #3
    Braaaaiiiins Zombie's Avatar
    Status
    Zombie is offline
    Join Date
    Oct 2010
    Posts
    2,545
    Post Thanks / Like
    Calm like a bomb.
     



    Re: Official Useful Shell Scripts Thread

    Quote Originally Posted by -Frost Knight- View Post
    Wait....what is shell scripts
    Shell (Though more importantly)
    Bash Shell
    BashFAQ

    Some helpful links. ;D

    Quote Originally Posted by khallil123 View Post
    this^
    Spam isn't necessary. Please click the edit button, and delete your post.
     
         

  4. #4
    God of Wood O_O HashiramaDescendant's Avatar
    Status
    HashiramaDescendant is offline
    Gender
    Join Date
    Mar 2012
    Location
    Xyloid City with Hashirama
    Posts
    5,565
    Post Thanks / Like
    안녕하세요! ^^
     

    Re: Official Useful Shell Scripts Thread

    Computer language script writing stuff... Very interesting.
    What exactly does it do?
     
         

  5. #5
    Braaaaiiiins Zombie's Avatar
    Status
    Zombie is offline
    Join Date
    Oct 2010
    Posts
    2,545
    Post Thanks / Like
    Calm like a bomb.
     



    Re: Official Useful Shell Scripts Thread

    Quote Originally Posted by HashiramaDescendant View Post
    Computer language script writing stuff... Very interesting.
    What exactly does it do?
    In bash, you can pretty much do anything and everything from executing programs to performing system maintenance such as clearing /var/logs on a daily or hourly basis. If you're interested in learning about bash scripting/programming, I'd highly suggest you read into GNU/Linux. I'm also always willing to answer questions, or clarify things as well.
     
         

  6. #6
    God of Wood O_O HashiramaDescendant's Avatar
    Status
    HashiramaDescendant is offline
    Gender
    Join Date
    Mar 2012
    Location
    Xyloid City with Hashirama
    Posts
    5,565
    Post Thanks / Like
    안녕하세요! ^^
     

    Re: Official Useful Shell Scripts Thread

    Quote Originally Posted by Zombie View Post
    In bash, you can pretty much do anything and everything from executing programs to performing system maintenance such as clearing /var/logs on a daily or hourly basis. If you're interested in learning about bash scripting/programming, I'd highly suggest you read into GNU/Linux. I'm also always willing to answer questions, or clarify things as well.
    Thanks, bro. :D
     
         

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •