The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
if test case in korn shell fluke_perf UNIX for Dummies Questions & Answers 3 03-28-2008 09:19 AM
Ignore case sensitive in Case Switch annelisa Shell Programming and Scripting 1 07-13-2006 01:36 AM
Removing duplicate lines ignore case hellsd UNIX for Dummies Questions & Answers 17 12-02-2004 07:47 AM
Shell script automation using case statement ianf Shell Programming and Scripting 6 09-12-2002 06:17 AM
lower case to upper case string conversion in shell script dchalavadi UNIX for Dummies Questions & Answers 3 05-28-2002 09:07 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-21-2006
AAH AAH is offline
Registered User
 

Join Date: Feb 2006
Posts: 1
Question Ignore Case in Shell

Hi

New to this Unix dot com.

I would like to know how i can ignore the case in filename which is getting as user directoty to shell script.

For Ex:

Source (/aa/bb/patch/)
Directory may contains more than 1 files as like

1. aa.csv or Aa.csv or AA.csv or aa.CSV
2. bb.csv
3. cc.CSV

I need to copy aa.csv to destination directory(/app/gh/dest/).

Thanks in advance for your help...

Regards
AAH
Reply With Quote
Forum Sponsor
  #2  
Old 02-21-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,653
In ksh you can ignore case several ways. Here is one:
Code:
$ ls Data daTa datA data
Data    daTa    datA    data
$ cat look
#! /usr/bin/ksh
target="data"
typeset -l lname
for name in * ; do
        lname=$name
        [[ $lname = $target ]] && echo $name
done
exit 0
$ ./look
Data
daTa
datA
data
$
Reply With Quote
  #3  
Old 02-21-2006
Registered User
 

Join Date: Feb 2006
Posts: 3
File Server PC Shares

Hi Everybody,

Can anyone help my users shared folder increase their space -- some of them has a cretical disk space 98% used space...

Please help us on how to increase their space nor any other way to prevent losing space from each folder..

Thanks you very.
Reply With Quote
  #4  
Old 03-21-2006
Registered User
 

Join Date: Jul 2005
Location: Mt. Prospect, Illinois
Posts: 32
Ignore CASE/case in script...

The means I use to ignore case, as an example is the following snippet:

read -p "Enter Y/N to continue: " YN
y|Y|YES|Yes|n|N|NO|No=`echo $YN | tr [:lower:][:upper:]`

This allows anybody using your script to supply a response of any kind or
variation and it will be converted to an upper CASE respones i.e. Y or N!

Good luck!

Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:45 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0