Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-15-2009, 12:06 PM   #1
Nature Nut
LQ Newbie
Registered: Mar 2009
Posts: 5

Rep: Reputation: 0
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.
Old 05-15-2009, 12:12 PM   #2
Senior Member
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
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.
Old 05-16-2009, 09:59 AM   #3
Nature Nut
LQ Newbie
Registered: Mar 2009
Posts: 5

Original Poster
Rep: Reputation: 0
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...'

Last edited by Nature Nut; 05-16-2009 at 10:00 AM. Reason: clarification of ls listings


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script for changing filename case Steve W Linux - Software 8 10-17-2008 03:15 AM
Make Linux case insensitive filename john_boys Linux - Desktop 5 03-29-2008 08:17 AM
rsync and FAT32 problems (filename case-sensitive) apachedude Linux - Software 5 01-21-2006 07:20 PM
filename encode question codec Linux - General 5 06-11-2005 02:59 PM
Renaming All Caps Filename Into Lower Case slpwkr Linux - General 3 06-03-2005 06:23 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration