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
DIR2OGG(1)						      General Commands Manual							DIR2OGG(1)

NAME
dir2ogg - Convert MP3, WAV, and M4A files to OGG format SYNOPSIS
dir2ogg [ options ] ( filename [filename2] ... || directory [directory2] ... || [cdrom-device] ... ) DESCRIPTION
dir2ogg converts MP3, M4A, WMA and WAV files to the open-source OGG format. dir2ogg is a python script that simply binds together mpg123, faad, and oggenc making it easier for the user to convert his/her music files. OGGs are about 15 to 20 percent smaller than MP3 files, with the same relative audio quality. dir2ogg can be called with the -d flag at the command line to convert any number of directories at once, or given MP3, M4A, WMA, and/or WAV filenames as arguments, dir2ogg will convert only those files. If converting WAV, M4A or WMA files with -d you must add the -w, -m or -W command line flags respectively. These flags are not neccesary unless using -d. Note that converting M4A files requires you to have faad installed, and converting WMA files requires mplayer. Keep in mind that converting from MP3 or M4A to OGG is a conversion between two lossy formats. This is fine if you just want to free up some disk space, but if you're a hard-core audiophile you may be disappointed. I really can't notice a difference in quality with 'naked' ears myself. General Options -h or --help print quick usage details to the screen. -d or --directory convert all MP3 files in directory. WAV and M4A files will be converted if used with the -w and -m command line flags. This option is for compatibility purposes only and does not need to be specified anymore. -r or --recursive like -d but descends recursively into directories. -c or --cdda Convert an audio CD into ogg. You may pass the device as an argument to the script (default: /dev/cdrom). Requires cdparanoia orq icedax or mplayer -p or --preserve-wav preserve all WAV files. By default they are deleted. -P or --no-pipe Do not use pipes to send data from the decoder to the encoder, use temporary wav files instead. --delete-input Delete the input file after conversion -v or --verbose increase dir2ogg's verbosity. -Q or --quiet Do not display progress messages, except the name of the file which is currently converted. Some decoders provide no way to disable messages and thus may still display some. Conversion options --convert-all Convert all supported audio files found in the directories given on the command-line to Ogg Vorbis. -f or --convert-ape Convert all APE (Monkey's Audio) files found in the directories given on the command-line to Ogg Vorbis, using either ogg123 or flac or mplayer. -f or --convert-flac Convert all FLAC (Free Lossless Audio Codec) files found in the directories given on the command-line to Ogg Vorbis, using ogg123 or flac or mplayer. -m or --convert-m4a convert all M4A (MPEG-4 Audio) files found in the directories given on the command-line to Ogg Vorbis, using faad or mplayer. For decoding ALAC (Apple Lossless) files, 'alac-decoder' may be used. -m or --convert-mpc convert all MPC (MusePack) files found in the directories given on the command-line to Ogg Vorbis, using mpcdec or mplayer. -W or --convert-wma Convert all WMA (Windows Media Audio) files found in the directories given on the command-line to Ogg Vorbis, using mplayer. -w or --convert-wav Convert all WAV files found in the directories given on the command-line to Ogg Vorbis. -V or --convert-wv Convert all WV (WavPack) files found in the directories given on the command-line to Ogg Vorbis. -n or --no-mp3 ingore all MP3 files found in directories given on the command-line. --(ape|cd|flac|m4a|mp3|mpc|wma|wv)-decoder=COMMAND Set the decoder you want to use for one filetype, e.g.: --mp3-decoder=lame. Run dir2ogg --help to see the available decoders. -qN or --quality=N OGG quality. N is a number between -1 and 10. Default is 3. Decimals are OK (ie: 3.7) -t or --smart-mp3 Try to use the same quality as the input file. MP3 input only! SEE ALSO
mpg123(1), mplayer(1), oggenc(1) BUGS
Enter you bug reports in Launchpad at https://bugs.launchpad.net/dir2ogg AUTHORS
0.10 and newer: Julian Andres Klode <jak@jak-linux.org> 0.9.3 and older: Darren Kirby <d@badcomputer.org> CONTRIBUTORS
original wma support: Cameron Stone <camerons@cse.unsw.edu.au> smart-mp3: Marek Palatinus <marek@palatinus.cz> dir2ogg 0.11.8 2009-08-04 DIR2OGG(1)
All times are GMT -4. The time now is 08:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy