Friday, 15 March 2013

Looping/iterating through files - in Linux, Bash Command Line/Shell


if [ "$1" == "" ]; then
  echo "Syntax: $0 filenames"
  echo "(filenames can be any (positive) number of files)"
  exit 1
for file in $@
  [ -f $file ] && echo "Full Path: $file - Base Filename: $(basename $file)"
  # note: Full Path will only contain a path if the input arguments contain paths.
  # basename will always strip the path, if any
  # the [ -f $file ] bit filters out files only, so we don't process directories

Thursday, 14 March 2013

[SOLVED] curl-config issue installing esniper on Ubuntu 12.04 Precise Pangolin

I recently installed esniper on Ubuntu 12.04 LTS (Precise Pangolin) and had problems installing it at first. Configure stopped on curl-config, even though curl was installed.

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes

Wednesday, 13 March 2013

TTYtter - A twitter client that makes twitter almost usable (like IRC)!

Twitter has been something I reluctantly used every 3-6 months or so, but I just did a search for command line twitter clients and was delighted that there were a few. I tried out one called TTYtter, which made twitter almost like IRC - in other words much more usable than the lame web interface!

Here's how to install on Ubuntu. I went for the latest version rather than the one in Ubuntu's repository.