-   Linux - Newbie (
-   -   Question regarding mv and filename case (

Nature Nut 05-15-2009 01:06 PM

Question regarding mv and filename case
Being new to linux, I'm running into some problems with scripts that I'm converting from OS/2 to bash. I've made some great headway, but have run into something I don't understand. I know that linux is case sensitive with filenames, so I don't understand why the following doesn't work.

mv ~/Website/GNPS/Utils/DataFilz/Calendar.TXT ~/Website/GNPS/Utils/DataFilz/Calendar.SAV > /dev/nul

mv ~/Website/GNPS/Utils/Work/calendar.tmp ~/Website/GNPS/Utils/DataFilz/Calendar.TXT > /dev/nul

In both cases, the resulting filename is all lower case, not mixed case as I want. I know that what I want isn't SOP for linux, but that's what I prefer and other scripts depend on the case of these filenames.

Poetics 05-15-2009 01:12 PM

Can you post the following commands and their results?


$ ls -l ~/Website/GNPS/Utils/DataFilz/
$ mv ~/Website/GNPS/Utils/DataFilz/Calendar.TXT ~/Website/GNPS/Utils/DataFilz/Calendar.SAV
$ mv ~/Website/GNPS/Utils/Work/calendar.tmp ~/Website/GNPS/Utils/DataFilz/Calendar.TXT
$ ls -l ~/Website/GNPS/Utils/DataFilz/

I'm wondering if your routing to /dev/null (is that a mistype in your post?) is nuking any output.

Nature Nut 05-16-2009 10:59 AM

Just posting the relevant sections of directory, it's pretty long and I see no point in wasting space.

Before mv commands
-rw-r--r-- 1 iris iris 81631 2009-05-11 13:22 Calendar.SAV
-rw-r--r-- 1 iris iris 88932 2009-05-15 09:12 Calendar.TXT

-rw-r--r-- 1 iris iris 88932 2009-05-15 09:12 Calendar.SAV
-rw-r--r-- 1 iris iris 79766 2009-05-14 20:04 Calendar.TXT

Interesting - it should be noted that the file size differences are due to a previous run of my script in which I changed the data in the datafile.

Since I got that result, I tried the script again and got the above result, even with the /dev/nul on the end.

Prior to yesterday's testing, I had responded to a notification of updates available (9.04) and it installed a bunch - 20 some odd IIRC. I did not reboot afterward since there was no notice about it being necessary. Maybe that was causing the problem? We had some bad storms last night and I shut down the computer til they were past. Now, after restarting, things seem to be working as expected.

It's my understanding that /dev/nul only catches what goes to the screen - or whatever device is set up for standard output. Is that not correct? I'm just trying to keep extraneous output off the screen as the script runs - when I run it directly in a terminal.

While I'm asking questions about scripts. Is it possible to set up a launcher to run a script and keep the window open when the script is done? I have a "pause" set up using the code below, but the window closes anyway from the launcher I set up.

pause() {
read -p "$*"

The call to the above is

pause 'Press Any Key to Continue...'

All times are GMT -5. The time now is 05:06 PM.