Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 207

How do I set $? or the return code in Bash?

$
0
0

I want to set a return value once so it goes into the while loop:

#!/bin/bashwhile [ $? -eq 1 ]do#do something until it returns 0    done

In order to get this working I need to set $? = 1 at the beginning, but that doesn't work.


Viewing all articles
Browse latest Browse all 207

Trending Articles