Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

typeset not working

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
XST1
Apprentice
Apprentice
Posts: 163
Joined: Tue Jan 27, 2004 12:11 am

typeset not working

  • Quote

Post by XST1 » Mon Jan 31, 2005 10:21 pm

I cant get typeset working for some reason.... heres my script:

Code: Select all

#!/bin/bash

for parameterList in $*
do
	typeset -u parameterList
	echo $parameterList
done

heres the warning I get:

typeset: usage: typeset [-afFirtx] [-p] name[=value] ...

-u should be an argument of typeset (-u is used to turn a string to uppercase and -l should turn a string to lowercase)
Top
ctt
Tux's lil' helper
Tux's lil' helper
Posts: 136
Joined: Sat Feb 05, 2005 1:11 am

Re: typeset not working

  • Quote

Post by ctt » Sat Feb 05, 2005 1:55 am

XST1 wrote:I cant get typeset working for some reason.... heres my script:

Code: Select all

#!/bin/bash

for parameterList in $*
do
	typeset -u parameterList
	echo $parameterList
done

heres the warning I get:

typeset: usage: typeset [-afFirtx] [-p] name[=value] ...

-u should be an argument of typeset (-u is used to turn a string to uppercase and -l should turn a string to lowercase)
You appear to be mistaken (based on the warning bash gave you, and bash(1)). As for an alternative, tr can be used to change case:

Code: Select all

#!/bin/bash

upper () {
  echo "$*" | tr [:lower:] [:upper:]
}

for param in "$@"
do
  echo "$(upper $param)"
done
Hope this helps,
- chris
Top
Post Reply

2 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic