All of lore.kernel.org
 help / color / mirror / Atom feed
* Capitalize a variable in a shell script
@ 2006-10-30 18:26 Diego Alencar Alves de Lima
  2006-10-31  0:50 ` Franklin Chua
  0 siblings, 1 reply; 2+ messages in thread
From: Diego Alencar Alves de Lima @ 2006-10-30 18:26 UTC (permalink / raw)
  To: linux

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

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
-- 
Diego Lima
http://sg.homelinux.com:81

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Capitalize a variable in a shell script
  2006-10-30 18:26 Capitalize a variable in a shell script Diego Alencar Alves de Lima
@ 2006-10-31  0:50 ` Franklin Chua
  0 siblings, 0 replies; 2+ messages in thread
From: Franklin Chua @ 2006-10-31  0:50 UTC (permalink / raw)
  To: Diego Alencar Alves de Lima; +Cc: linux

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

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... :)


[-- Attachment #2: fchua.vcf --]
[-- Type: text/x-vcard, Size: 404 bytes --]

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=0D=0A=
	NECFAX: 800 63 (91) 5209
x-mozilla-html:TRUE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-31  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-30 18:26 Capitalize a variable in a shell script Diego Alencar Alves de Lima
2006-10-31  0:50 ` Franklin Chua

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.