I'm writing a script in Bash to test some code. 我正在Bash中編寫腳原本測試一些代碼。 However, it seems silly to run the tests if compiling the code fails in the first place, in which case I'll just abort the tests. 可是,若是編譯代碼首先失敗,則運行測試彷佛很愚蠢,在這種狀況下,我將停止測試。 app
Is there a way I can do this without wrapping the entire script inside of a while loop and using breaks? 有沒有一種方法能夠在不將整個腳本包裝在while循環內並使用break的狀況下作到這一點? Something like a dun dun dun goto? 像dun dun dun goto之類的東西? ide