| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
| List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT sources DOT redhat DOT com |
| Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
| Message-Id: | <5.0.2.1.2.20010312070340.00a97048@ks.teknowledge.com> |
| X-Sender: | rschulz AT ks DOT teknowledge DOT com |
| X-Mailer: | QUALCOMM Windows Eudora Version 5.0.2 |
| Date: | Mon, 12 Mar 2001 07:12:46 -0800 |
| To: | Galen Boyer <galenboyer AT yahoo DOT com>, cygwin AT sourceware DOT cygnus DOT com |
| From: | Randall R Schulz <rschulz AT teknowledge DOT com> |
| Subject: | Re: KSH to Bash conversion |
| In-Reply-To: | <ur903uobj.fsf@yahoo.com> |
| Mime-Version: | 1.0 |
Galen,
It looks like BASH once had a typeset built-in, but no more. However, it
apparently never supported a "-u" option:
--====----====----====----====----====----====----====----====----====----====--
1004> help typeset
typeset: typeset [-afFrxi] [-p] name[=value] ...
Obsolete. See `declare'.
1005> help declare
declare: declare [-afFrxi] [-p] name[=value] ...
Declare variables and/or give them attributes...
The flags are:
-a to make NAMEs arrays (if supported)
-f to select from among function names only
-F to display function names without definitions
-r to make NAMEs readonly
-x to make NAMEs export
-i to make NAMEs have the `integer' attribute set
....
--====----====----====----====----====----====----====----====----====----====--
So, knowing no more "direct" solution here's what I'd do:
1008> "var=UpPeR- AnD LoWeR-CaSe"
1009> echo $var
UpPeR- AnD LoWeR-CaSe
1010> uVar="$(echo "$var" |tr 'a-z' 'A-Z')"
1011> echo $uVar
UPPER- AND LOWER-CASE
1012> lVar="$(echo "$var" |tr 'A-Z' 'a-z')"
1013> echo $lVar
upper- and lower-case
Randall Schluz
At 05:08 3/12/2001, you wrote:
>In KSH, I have the following statement:
>
>typeset -u TableName=$2
>
>Then, I was assured that immdiately when the parameter was
>recieved by the script it was converted to uppercase. I need the
>corresponding statement in Bash.
>
>Thanks,
>--
>Galen Boyer
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |