Bash-Anleitung: Unterschied zwischen den Versionen

Aus crazylinux.de
Zur Navigation springen Zur Suche springen
(tr...)
K (guide)
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 1: Zeile 1:
Eine tolle Einführung gibt's unter http://www.linuxfibel.de/bash.htm
Eine tolle Einführung gibt's unter http://www.linuxfibel.de/bash.htm oder [http://wooledge.org:8000/BashGuide BashGuide]<br>


<br>


=How to convert a string to upper or lower case in bash?=
= How to convert a string to upper or lower case in bash? =
from http://blog.spikesource.com/bashstringconversion.htm


Assuming tr is available on the system,
from http://blog.spikesource.com/bashstringconversion.htm


Convert the given argument into an all lower case string.
Assuming tr is available on the system,
 
Convert the given argument into an all lower case string.  


  toLower() {
  toLower() {
Zeile 13: Zeile 15:
  }  
  }  


Convert the given argument into an all lower case string.
Convert the given argument into an all lower case string.  


  toUpper() {
  toUpper() {
   echo $1 | tr "[:lower:]" "[:upper:]"  
   echo $1 | tr "[:lower:]" "[:upper:]"  


<br>
= Lautsprecher bei der Shell ausstellen  =
setterm -blength 0
<br> keywords: sh,bash,linux,console,cmd,command,shell
[[Category:Linux]] [[Category:Tips_und_Tricks]]


keywords: sh,bash,linux,console,cmd,command,shell
[[Kategorie:Linux]]
[[Category:Linux]][[Category:Tips_und_Tricks]]
[[Kategorie:Tips_und_Tricks]]

Aktuelle Version vom 26. Februar 2009, 11:21 Uhr

Eine tolle Einführung gibt's unter http://www.linuxfibel.de/bash.htm oder BashGuide


How to convert a string to upper or lower case in bash?

from http://blog.spikesource.com/bashstringconversion.htm

Assuming tr is available on the system,

Convert the given argument into an all lower case string.

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

Convert the given argument into an all lower case string.

toUpper() {
 echo $1 | tr "[:lower:]" "[:upper:]" 


Lautsprecher bei der Shell ausstellen

setterm -blength 0


keywords: sh,bash,linux,console,cmd,command,shell