Senji (senji) wrote,
Senji
senji

  • Mood:

Stuff what I have done today.

I'm feeling quite chuffed about thinking at right angles to problems today; having achieved a few tasks in deceptively simple ways.

For example; to find every occurance of a bitstring in a binary file (I was looking for ÿÿÿÿ):
sed 's/ÿÿÿÿ/-ÿÿÿ/g' <file.orig >file.evil
cmp -bl file.{evil,orig} | sed 's/ 55.*//'


And a simple function for doing things multiple times:
times ()
{
__times_repeats=$1;
shift;
for __times_loopv in $(seq 1 $__times_repeats);
do
$@;
done;
unset __times_loopv;
unset __times_repeats
}

(I expect that there are probably obvious bugs in that!)
Tags: geeky, shell hacks, work
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 4 comments