LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-12-2008, 04:08 AM   #1
naveensankineni
LQ Newbie
 
Registered: Feb 2008
Posts: 11

Rep: Reputation: 0
script to list the filenames which are in lower case


Hi,

I just want to check the file names in the directory are lower case or upper case and i want to print the filenames which are upper case.

Can u please help me out
 
Old 03-12-2008, 04:13 AM   #2
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
do you mean anything that has uppercase or has all uppercase?

here's a method using grep.. i know you can also do this in sed or do file globbing that uses regular expression in bash.

has uppercase: 'ls | grep "[A-Z]"'
has all uppercase (no lowercase method): 'ls | grep -v "[a-z]"'
has all uppercase (everything should be except periods of course): 'ls | grep "^[A-Z]\+\.\{0,1\}[A-Z]*$"'

Last edited by konsolebox; 03-12-2008 at 04:21 AM.
 
Old 03-12-2008, 07:09 AM   #3
naveensankineni
LQ Newbie
 
Registered: Feb 2008
Posts: 11

Original Poster
Rep: Reputation: 0
i have to check the filenames of .sql extension are with lower case letters,if any upper case filenames are there i need to print those file names
 
  


Reply


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 converting filenames to proper case? Yalla-One Programming 9 02-03-2010 02:37 AM
renaming directories from upper case to lower case, help!! linux_teller Linux - Newbie 3 03-07-2008 05:15 AM
Why are all my upper case files being shown as lower case?? [Kernel 2.6.9-1.667 FC3] t3gah Fedora 4 03-11-2005 04:09 PM
Lower case to upper case letter sudhasmyle Programming 1 12-03-2004 04:15 AM
Apache and upper or lower case. dsiguy Linux - General 3 02-04-2003 11:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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