From: John on
Hi all.

Another beginner question. For which I did do a thorough search
before posting.

Can any of the commands cp, mv or rm be made to act in a case-
insensitive manner? I see no such switch listed in the man pages, so
I have a strong suspicion the answer is a simple "no".

And if my assumption is right, what tricks might I employ to simulate
case-insensitive behaviour?

Thanks!
John
From: pk on
On Thursday 17 July 2008 15:06, John wrote:

> Hi all.
>
> Another beginner question. For which I did do a thorough search
> before posting.
>
> Can any of the commands cp, mv or rm be made to act in a case-
> insensitive manner? I see no such switch listed in the man pages, so
> I have a strong suspicion the answer is a simple "no".
>
> And if my assumption is right, what tricks might I employ to simulate
> case-insensitive behaviour?

With bash, you can do

shopt -s nocaseglob

see man bash for the details.

From: Philipp Pagel on
John <john.william.fitzpatrick(a)gmail.com> wrote:
> Can any of the commands cp, mv or rm be made to act in a case-
> insensitive manner? I see no such switch listed in the man pages, so
> I have a strong suspicion the answer is a simple "no".

I'm nit sure what you mean by "case insensitive manner". Can you give an
example, of what you would like them to do?

cu
Philipp

--
Dr. Philipp Pagel
Lehrstuhl f. Genomorientierte Bioinformatik
Technische Universit�t M�nchen
http://mips.gsf.de/staff/pagel
From: Chris Davies on
John <john.william.fitzpatrick(a)gmail.com> wrote:
> Can any of the commands cp, mv or rm be made to act in a case-
> insensitive manner?

No. But I suppose you could roll your own script(s) that implemented this.

#!/bin/sh
#
# Very simple UNTESTED implemention of cp/rm/mv with case-insensitive
# filenames. Switch processing omitted for brevity (see getopts)
#
TMP=/tmp/ci.$$

printf "/bin/%s" `basename "$0"` >>"$TMP"

for ARG in "$@" do
MIX=`
echo "$ARG" | awk '{
for (i = 1; i <= length($0); i++) {
c = substr($0,i,1);
print "[" tolower(c) toupper(c) "]"
}
}'
`
printf " '%s'" >>"$TMP"
done
echo >>"$TMP"

sh "$TMP"
SS=$?

rm -f "$TMP"
exit "$SS"


> And if my assumption is right, what tricks might I employ to simulate
> case-insensitive behaviour?

UNIX/Linux file systems are inherently case sensitive. The usual way
is to stop using capitals and use only lowercase for filenames. Trying
to force case-insensitivity on a case-sensitive system is asking for
trouble later on.

Chris
From: Mark Hobley on
John <john.william.fitzpatrick(a)gmail.com> wrote:
> And if my assumption is right, what tricks might I employ to simulate
> case-insensitive behaviour?

You could use a case insensitive filesystem (such as FAT32), or patch
the file create and referencing routines to translate given filenames to a
particular lettercase before writing or referencing a file.

I am interested in lettercase patches, if you decide to go this route.

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.