20140128 list processing with bash - plembo/onemoretech GitHub Wiki

title: List processing with bash link: https://onemoretech.wordpress.com/2014/01/28/list-processing-with-bash/ author: phil2nc description: post_id: 6928 created: 2014/01/28 16:31:56 created_gmt: 2014/01/28 21:31:56 comment_status: closed post_name: list-processing-with-bash status: publish post_type: post

List processing with bash

Just a simple example of a bash script to process items found in a list. [code language="bash" gutter="false"] #!/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 [/code] This script takes a list of uid values and appends text to form an image name.

Copyright 2004-2019 Phil Lembo