Scratchpad

Scratchpad

A blog, of sorts, intended as a place to experiment, struggle, question, and play with whatever research I am currently working on. The themes will thus change over time as my projects change, and the entries may be quotations that strike my fancy, attempts to puzzle through hairy problems, notes on sources, experiments, musings, dead ends, odd angles of looking at things. It is a voice to my frustrations, discoveries, curiosities, and confusions. It is thinking out loud. ...More subscribe to this blog

Iteration in bash

, ,

4 Jan 2008

I'm a terrible programmer, mainly because I only try to do it when I really need something, instead of just sequestering myself in a room with cheesy puffs and Dr. Pepper for 2 weeks to just do it already. So I find myself having to keep notes when I do anything successfully lest I forget when I need to program again 6 months later. Even the really, really simple shit. Sigh.

Changing file names quickly in a Linux directory with a billion files:


for i in $(ls -1 s_*.gif);
do (( n++ )); mv $i file$n.gif ;
done