tips:linux:changecase
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | tips:linux:changecase [2009/06/08 14:59] (current) – created erik | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Changing the case of a variable or filename in a shell script ====== | ||
| + | |||
| + | Converting a variable to upper or lower case can be accomplished using **tr**. | ||
| + | |||
| + | For example: | ||
| + | |||
| + | < | ||
| + | #!/bin/sh | ||
| + | LOWER=" | ||
| + | UPPER=`echo $LOWER | tr a-z A-Z` | ||
| + | echo $UPPER | ||
| + | </ | ||
| + | |||
| + | will output: | ||
| + | |||
| + | < | ||
| + | ERIK | ||
| + | </ | ||
tips/linux/changecase.txt · Last modified: by erik
