Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[bash] vordefinierte Variablen
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2953
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Sat Mar 25, 2006 3:08 pm    Post subject: [bash] vordefinierte Variablen Reply with quote

Hallo

ich schreibe öfters bash Skripte und ich hab kaum Probleme damit, aber manchmal komme ich nicht weiter und guck, was andere Skripte so machen. Manchmal verstehe ich sofort, was da gemacht wird, manchmal bleib ich an manchen Sachen hängen, weil ich nicht genau weiß, was manche Sachen bedeuten.

Es gibt von bash vordefinierte Variablem wie $0, $1, $2, usw. die C/C++ argv[0], argv[1] entsprechen.
Ich nehme an, dass $# der Anzahl von Argumenten entspricht, oder?
Ich sehe immer öfters $@, ist das soz. eine Abkürzung für $1 $2 $3, oder?
Was bedeutet "$*" ? das habe ich auch gesehen, aber ich verstehe nicht, wozu das gut sein soll.
Ich weiß, dass $? den exit-status des letzten Befehls speichert.
Gibt es weitere solche vordefinirte Variablen?


Von bash finde ich ganz toll, dass man den Inahlt eine Variable bei der Ausgabe modifizieren kann, ohne sie wirklich zu verändern, wie ${MYVAR#hallo} oder ${MYVAR%hallo}. Aber es gibt einige davon, die ich ncht ganz verstehe, was die tun: ${TIMEOUT:-"10"}
was bedeutet :-"10" ? Welche Auswirkung hat es bei der Ausgabe von ${TIMEOUT}?
gibt noch weitere solche Hilfmittel für die Ausgabe von Variablen?

Kennt ihr gute Tutorials, wo ich diese "advanced" Sachen nachschauen kann?

Danke
Gruss
Pablo
_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!
Back to top
View user's profile Send private message
Carlo
Developer
Developer


Joined: 12 Aug 2002
Posts: 3356

PostPosted: Sat Mar 25, 2006 3:33 pm    Post subject: Reply with quote

Die bash man page ist eigentlich recht ausführlich. Ansonsten gibt's noch den Advanced Bash-Scripting Guide.
_________________
Please make sure that you have searched for an answer to a question after reading all the relevant docs.
Back to top
View user's profile Send private message
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2953
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Sat Mar 25, 2006 3:34 pm    Post subject: Reply with quote

Carlo wrote:
Die bash man page ist eigentlich recht ausführlich. Ansonsten gibt's noch den Advanced Bash-Scripting Guide.


danke für den Link. Ich lese die man page sehr oft, aber manchmal suche ich nur etwas bestimmtes und dafür ist sie zu groß :) aber das meiste Wissen habe ich aus den man pages.
_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!
Back to top
View user's profile Send private message
marc
Apprentice
Apprentice


Joined: 13 Jan 2003
Posts: 290

PostPosted: Tue Mar 28, 2006 6:48 am    Post subject: Reply with quote

arg's ...
http://www.tldp.org/LDP/abs/html/refcards.html#AEN16787

ersetzungsoperator :
http://www.tldp.org/LDP/abs/html/refcards.html#AEN17103


Das sollte helfen.

Gruß
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum