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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to Convert Upper case to Lower case grahambo2005 Shell Programming and Scripting 7 07-12-2009 10:15 AM
how to convert from upper to lower case aoussenko Shell Programming and Scripting 5 06-03-2009 03:59 PM
how to convert value in a variable from upper case to lower case manmeet Shell Programming and Scripting 2 11-13-2008 02:22 PM
Change Case UPPER-lower & lower - UPPER rahulkav Shell Programming and Scripting 7 09-14-2008 03:50 AM
lower case to upper case string conversion in shell script dchalavadi UNIX for Dummies Questions & Answers 3 05-29-2002 01:07 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-04-2009
vz6zz8 vz6zz8 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 2
convert upper case to lower case in ascript

I have a package to install and the installation script which does it . The files/directories names in the script are all lower case but the actual package has everything in upper case - file names, directories . I don't want to rename directories and files in the package - it has a lot of them . But I can not use the script as it is - it does not recognize files names . What would be the easiest way to deal with this ???

Example

script has command
cp -f $var1/$var2/dirname_1/filename_1 ......
and the package has
/../../DIRNAME_1/FILENAME_1


I roughly estimated that there's about 60 lines in the script that have the dir and filenames which would need to be converted. It's uses a /bin/sh script .
  #2 (permalink)  
Old 06-04-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514

Code:
$ old=/../../DIRNAME_1/FILENAME_1
$ echo $old
/../../DIRNAME_1/FILENAME_1

$ new=$(echo $old | tr '[A-Z]' '[a-z]')

$ echo $new
/../../dirname_1/filename_1

-Devaraj Takhellambam
  #3 (permalink)  
Old 06-04-2009
vz6zz8 vz6zz8 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 2
Hi DEVTAKH thanks for the reply , but I need a bit more than just using tr . What I essentially want is for the install script to be able to recognise the directories and file names which are all in Upper case, but in the script are written as lowercase . For example

Script has
cp -f $var1/$var2/dirname_1/filename_1 ../../../
the package has
/../DIRNAME_1/FILENAME_1

I do not want change the whole command just for the cp to find $var1/$var2/DIRNAME_1/FILENAME_1
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0