Capitalize a variable in a shell script

Capitalize a variable in a shell script

am 30.10.2006 19:26:09 von Diego Alencar Alves de Lima

--nextPart2099294.P586NfjTW9
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

How can I capitalize an existing variable in a shell script? Currently=20
$variable is www.domain.com, and I need to create a $variable1 that contain=
s=20
WWW.DOMAIN.COM (I am currently using bash as shell)

Thanks a lot
=2D-=20
Diego Lima
http://sg.homelinux.com:81

--nextPart2099294.P586NfjTW9
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBFRkPEMQUVtGjCvrMRAlIAAJ9JPPAK1KDxXnuz0MJRg1GRqofRzwCg hgxQ
YEKIiJFGfuFXdaLMMlOUmq4=
=CUGl
-----END PGP SIGNATURE-----

--nextPart2099294.P586NfjTW9--
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: Capitalize a variable in a shell script

am 31.10.2006 01:50:12 von Franklin Chua

This is a multi-part message in MIME format.
--------------020704090803010000010808
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

Try this...

variable2=`echo $variable1 | tr [a-z] [A-Z]`

Cheers,
Frank

Diego Alencar Alves de Lima wrote:
> How can I capitalize an existing variable in a shell script? Currently
> $variable is www.domain.com, and I need to create a $variable1 that contains
> WWW.DOMAIN.COM (I am currently using bash as shell)
>
> Thanks a lot
>


--
Best if consumed promptly upon delivery or take out... :)


--------------020704090803010000010808
Content-Type: text/x-vcard; charset=utf-8;
name="fchua.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="fchua.vcf"

begin:vcard
fn:Franklin Chua
n:Chua;Franklin
org:NEC Telecom Software Philippines, Inc.
adr:;;2nd Flr. Bonifacio Technology Center;Taguig, Metro Manila;;;Philippines
email;internet:fchua@ntsp.nec.co.jp
title:Software Design Engineer II
tel;work:+632 818-0913
tel;fax:+632 818-0927
note;quoted-printable:NECNET: 800 63 (91) 5411 =
NECFAX: 800 63 (91) 5209
x-mozilla-html:TRUE
version:2.1
end:vcard


--------------020704090803010000010808--

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs