Bash-Anleitung: Unterschied zwischen den Versionen

Aus crazylinux.de
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
 
K (guide)
 
(3 dazwischenliegende Versionen desselben Benutzers werden 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>


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