List processing with bash

Just a simple example of a bash script to process items found in a list.

#!/bin/bash

INPUT=/data/tmp/just-users.txt
OLDIFS=$IFS
IFS=,

[! -f $INPUT] && { echo "$INPUT file not found"; exit 99; }

while read uid
do
    THUMBEXT=".jpg"
    PROFEXT="_profile.jpg"

    echo "$uid$THUMBEXT"
    echo "$uid$PROFEXT"

done < $INPUT
IFS=$OLDIFS

This script takes a list of uid values and appends text to form an image name.

This entry was posted in System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).