Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Xubuntu User (http://www.linux-archive.org/xubuntu-user/)
-   -   Precise problem with file name case (in)sensitivity (http://www.linux-archive.org/xubuntu-user/697089-precise-problem-file-name-case-sensitivity.html)

MR ZenWiz 08-23-2012 06:20 PM

Precise problem with file name case (in)sensitivity
 
I have a shell script I use to convert TIFFs into PDFs using tiffcp
and tiff2pdf. Today I had occasion to use it with some interesting
results.

Here is the shell script:

#!/bin/bash

if [[ -z "$1" || "$1" == "-h" ]]; then
echo "Usage: `basename $0` [-c <combined-tif>] {<file-name>|<file-base>}..."
echo " where <file-name> includes the '.tif' and <file-base> does not."
exit 0
fi

if [[ "$1" == "-x" ]]; then
shift
set -x
fi

if [[ "$1" == "-c" ]]; then
tgt=$2
shift 2
k=`basename $tgt .tif`
if [[ $tgt == $k ]]; then # add the "tif" suffix
tgt="$k.tif"
fi
echo "tiffcp $* $tgt"
tiffcp $* $tgt # combine all the tifs into one
set $tgt # and change the parameters to just this one
fi

for i in $*; do
j=`basename $i .tif`
if [ $j = $i ]; then
i="$i.tif"
fi
j="$j.pdf"
echo "tiff2pdf $i > $j"
tiff2pdf -z $i > $j
done

---

I had four TIFFs I wanted to combine into a single one and from there
into a single pdf, to I ran it thus:

tif2pdf -c NajC0823 najC0823?.tif

What it should have done is this: combine the najC0823?.tif files into
a single TIFF called NajC0823.tif, then convert that into
NajC0823.pdf.

However, what it did was convert NajC0823.tif into najC0823.pdf. When
I try to rename the actual result file (with the first letter lower
cased) to the intended result name (with the first letter upper
cased), mv says the two names are the same file.

Since when do the commands, including bash and mv, if not others, not
allow/recognize.enforce case sensitivity in file names? Or is it
something else?

MR

--
xubuntu-users mailing list
xubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/xubuntu-users


All times are GMT. The time now is 10:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.