#!/bin/sh
# This Bourne shell script renames JPEG image files of the form
# name.jpg:comment to name.jpg with embedded "comment".

# This is a Nautilus helper script.  Remove the redefinition of IFS
# and replace $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS with "$@" to
# convert this script to a general-purpose shell script.

# This script is in the public domain.  marko.makela (at) iki.fi, Nov 4, 2005.

# treat all errors as fatal
set -eu
IFS="
"
jpegcom $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS |
sed -e 's/^copy \(".*"	".*\.jpg\): */rename \1" "/;' |
jpegcom
