• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

davidmharding

technically enthusiastic

  • welcome
  • portfolio
  • resumé
  • contact

Bashing

You are here: Home / Uncategorized / Bashing

October 24, 2015 by dmh

There’s always something satisfying to solving problems, even small ones, via programming.

As chief cook and bottle washer on my work site, I’m not only architecting, designing, coding and programming, but also frequently preparing new content. Often this content comes with its own small headaches.  For instance, we receive product image files from vendors whose file names begin with the product ID (good) but end with some other text (bad).  With a few files of course the fastest fix is just to edit the titles directly, but when scores (or hundreds, or thousands) need fixing, it’s time to automate.

I could write a PHP CLI script for this, and it would be a good time to explore Node; but then again, Bash is there at hand.  Simple is usually (always?) best.

I’m not a Bash pro, though I’m on the command line all the time. Fortunately the Internet is at our fingertips. Shell script lookup! The need to learn is an itch needing a scratch.

Just a few lines: Iterate the files, split the file names on spaces or whatever, mv to the new name, and Robert remains your mother’s brother.

Filed Under: Uncategorized

Primary Sidebar

Recent Posts

  • includes v. indexOf
  • Bashing
  • Product Slideshow Revisited
  • AcademyX JS for Programmers + jQuery Brush-Ups
  • AcademyX Marks the Spot

Recent Comments

    Archives

    • May 2016
    • October 2015
    • February 2015
    • June 2013
    • February 2013
    • April 2012
    • March 2012
    • February 2012
    • January 2012
    • December 2011
    • November 2011
    • October 2011
    • September 2011

    Categories

    • art/design
    • design/art
    • dev
    • education
    • self-promotion
    • Uncategorized
    • webdev

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Footer

    • LinkedIn
    • Pinterest
    • Twitter

    Copyright © 2023 · Studio Pro on Genesis Framework · WordPress · Log in