20 Oct
2003
20 Oct
'03
07:30
Ralf Corsepius wrote:
On Sun, 2003-10-19 at 22:02, Alexander Veit wrote:
Hallo Leute!
Gibt es eine effektivere Methode (builtin-Kommando) als (exit N) , um innerhalb eines Bash-Scriptes den Wert des Parameters $? zu verändern?
Nein.
man bash: ... Special Parameters The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. ...
? Expands to the status of the most recently executed foreground pipeline.
D.h. Du kannst $? nicht setzen.
Das würde ich so nicht stehen lassen: ~> true ~> echo $? 0 ~> false ~> echo $? 1 CU Dierk