Sponsored Content
Full Discussion: Uppercase to lowercase
Top Forums Shell Programming and Scripting Uppercase to lowercase Post 302724669 by cfajohnson on Thursday 1st of November 2012 06:35:24 AM
Old 11-01-2012
Quote:
Originally Posted by fpmurphy
You can do it first letter capitalization easily from within Bash.

For example:
Code:
FirstCap()
{
   lower=${1,,}
   echo ${lower^}


These require bash4.
Quote:
Code:
}

ls -1 *.MP3  |  while read filename


First, -1 is not necessary since the output of ls is not going to a terminal.

Second, ls is not necessary:
Code:
for filename in *.MP3

Quote:
Code:
do
      FirstCap  $filename
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

uppercase to lowercase

Greetings & Happy New Years To All! A client of mine FTP'ed their files up to the server and it all ended up being in UPPERCASE when it all should be in lowercase. Is there a builtin command or a script anyone knows of that will automagically convert all files to lowercase? Please advise asap... (4 Replies)
Discussion started by: webex
4 Replies

2. Shell Programming and Scripting

How convert lowercase or uppercase

It will only accept one argument where it should be upper or lowercase. if user choose to convert filnames to upper case than it should convert to upper or vice versa. if no action taken by the user then should not do anything any of the files in the current directory. (5 Replies)
Discussion started by: Alex20
5 Replies

3. Shell Programming and Scripting

UPPERCASE to lowercase with no overwriting?

Hey, I've just started learning shell script today. How would I write a bash script file that changes file names from uppercase to lowercase in that directory, the program should warn the user and NOT overwrite the existing file if it's already in lowercase? for example in a directory i... (1 Reply)
Discussion started by: lgd923
1 Replies

4. AIX

Lowercase to Uppercase

Inside a script I have 2 variables COMP=cy and PT=t. further down the same script I require at the same line to call those 2 variables the first time uppercase and after lowercase ${COMP}${PT}ACE,${COMP}${PT}ace. Can somebody help me Thanks in advance George Govotsis (7 Replies)
Discussion started by: ggovotsis
7 Replies

5. UNIX for Dummies Questions & Answers

uppercase to lowercase

i have no variable and no file i just want to convert AJIT to ajit with some command in UNIX can anybody help (4 Replies)
Discussion started by: ajit.yadav83
4 Replies

6. Shell Programming and Scripting

indentation and lowercase to uppercase

hi, i need to write a bash script that does two things. the program will take from the command line a file name, which is a C code, and an integer, which is the size of my indentation i would then have to indent every nested code by the number of columns provided by the user in the... (1 Reply)
Discussion started by: kratos.
1 Replies

7. UNIX Desktop Questions & Answers

Unix: lowercase to uppercase

I just started to learn unix... and i needed to make a basic script. i need to 1. read a file (.txt) 2. count the words of EVERY sentece 3. sentences with odd number of words need to be converted into lowercase sentences with even number of words need to be converted into uppercase ... (6 Replies)
Discussion started by: chilli1988
6 Replies

8. UNIX for Dummies Questions & Answers

UPPERCASE to lowercase

Hi All, i have a file and i want to convert all uppercase letters to lowercase letters which are in my file. how can i do this. Thanx (3 Replies)
Discussion started by: temhem
3 Replies

9. Shell Programming and Scripting

Uppercase to lowercase and vice versa

shell script to convert file names from UPPERCASE to lowercase file names or vice versa in linux anybody please help me out!!!! (5 Replies)
Discussion started by: jacky29
5 Replies

10. Shell Programming and Scripting

Convert lowercase to uppercase

listprocs.sh contains ps -ef | grep "swikar" 1) Write a shell script to convert an input file to all upper case. Name your shell script toupper.sh. Hint: tr ' ' ' ' will convert all lower case letters to upper case To use your script, try the following command: cat... (1 Reply)
Discussion started by: swikar
1 Replies
ISPELLAFF2MYSPELL(1)					User Contributed Perl Documentation				      ISPELLAFF2MYSPELL(1)

NAME
ispellaff2myspell - A program to convert ispell affix tables to myspell format. SYNOPSIS
ispellaff2myspell [options] <affixfile> --myheader your_header Options: --affixfile=s Affix file --bylocale Use current locale setup for upper/lowercase conversion --charset=s Use specified charset for upper/lowercase conversion (defaults to latin1) --debug Print debugging info --extraflags=s Allow some non alphabetic flags --lowercase=s Lowercase string --myheader=s Header file --printcomments Print commented lines in output --replacements=s Replacements file --split=i Split flags with more that i entries --uppercase=s Uppercase string DESCRIPTION
ispellaff2myspell is a script that will convert ispell affix tables to myspell format in a more or less successful way. This script does not create the dict file. Something like ( echo `cat mydict.words+ | wc -l`; cat mydict.words+ ) > mydict.dict should do the work, with mydict.words+ being the munched wordlist OPTIONS
--affixfile=s Affix file. You can put it directly in the command line. --bylocale Use current locale setup for upper/lowercase conversion. Make sure that the selected locale match the dictionary one, or you might get into trouble. --charset=s Use specified charset for upper/lowercase conversion (defaults to latin1). Currently allowed values for charset are: latin0, latin1, latin2, latin3. --debug Print some debugging info. --extraflags:s Allows some non alphabetic flags. When invoked with no value the supported flags are currently those corresponding to chars represented with the escape char as first char. will be stripped. When given with the flag prefix will allow that flag and strip the given prefix. Be careful when giving the prefix to properly escape chars, e.g. you will need -e "\\" or -e '\' for flags like [ to be stripped to [. Otherwise you might even get errors. Use -e "^" to allow all flags and pass them unmodified. You will need a call to -e for each flag type, e.g., -e "\\" -e "~\\" (or -e '\' -e '~\'). When a prefix is explicitely set, the default value (anything starting by ) is disabled and you need to enable it explicitely as in previous example. --lowercase=s Lowercase string. Manually set the string of lowercase chars. This requires --uppercase having exactly that string but uppercase. --myheader=s Header file. The myspell aff header. You need to write it manually. This can contain everything you want to be before the affix table --printcomments Print commented lines in output. --replacements=file Add a pre-defined replacements table taken from 'file' to the .aff file. Will skip lines not beginning with REP, and set the replacements number appropriately. --split=i Split flags with more that i entries. This can be of interest for flags having a lot of entries. Will split the flag in chunks containing i entries. --uppercase=s Uppercase string. Manually set the sring of uppercase chars. This requires --lowercase having exactly that string but lowercase. If your encoding is currently unsupported you can send me a file with the two strings of lower and uppercase chars. Note that they must match exactly but case changed. It will look something like $lowercase='a-zaaaa~aeaaaeceeeeeiiiie`n~oooo~oeouuuueyp'; $uppercase='A-ZAAAA~AeAaCEEEEeIIIIe-N~OOOO~OeOUUUUeYP'; SEE ALSO
The OpenOffice.org Lingucomponent Project home page <http://lingucomponent.openoffice.org/index.html> and the document <http://lingucomponent.openoffice.org/affix.readme> that provides information about the basics of the myspell affix file format. You can also take a look at /usr/share/doc/libmyspell-dev/affix.readme.gz /usr/share/doc/libmyspell-dev/README.compoundwords /usr/share/doc/libmyspell-dev/README.replacetable in your Debian system. AUTHORS
Agustin Martin <agustin.martin@hispalinux.es> perl v5.10.1 2010-08-24 ISPELLAFF2MYSPELL(1)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy