Artificial intelligent assistant

simple bash while loop creates an unwanted file named 0 For some inexplicable reason, when I run the following code (minimalized, obviously) a file called "0" is created. Could somebody please explain why this happens, and how to avoid it? Thanks very much #!/bin/bash while [ 1 > 0 ] do exit done

`> 0` redirects to a file named `0`. Note `> something` or similar syntax does not have to be at the end. The file will be created even if the command being redirected doesn't make sense. In your case the command is `[ 1 ]` and it's syntactically valid: it checks if `1` is a non-empty string.

You probably meant `[ 1 -gt 0 ]`. See `help [` and `help test | less`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy befa4a3e483269491ea360695b5bf73c