3 ms·
TIL the `until` shell syntax: https://github.com/patte/fly-tailscale-exit/blob/main/start.sh https://github.com/patte/fly-tailscale-exit/blob/main/start....
by linux2647 3y ago
TIL the `until` shell syntax: https://github.com/patte/fly-tailscale-exit/blob/main/start.sh https://github.com/patte/fly-tailscale-exit/blob/main/start....
- vrosas 3y agoUntil is great. I use it to remind me if Docker Desktop isn’t running when I try and deploy an app until docker info > /dev/null 2>&1; do echo ”docker isn’t running…” && sleep 2; done
- floodle 3y agoHow is that different from `while !`?
- abwizz 3y ago'until' executes the statement before the condition. while checks the condition first. should have probably let you find this out for your self.
- jraph 3y agoThis is wrong. You must be confusing with the do..while construct we find in some programming languages. until indeed seems like syntax sugar for while !, I don't think there's a difference.
- ykonstant 3y ago> 'until' executes the statement before the condition. This is not the case. From the Open Group Base Specifications Issue 7, 2018 edition, 2.9.4 Compound Commands, The until loop: The format of the until loop is as follows: until compound-list-1 do compound-list-2 done The compound-list-1 shall be executed, and if it has a zero exit status, the until command completes. Otherwise, the compound-list-2 shall be executed, and the process repeats.
- karatinversion 3y agoIt's not, except it's a bit nicer to type