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

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 210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>