I have a very simple question that I can\'t answer. In shell, what would this command do:
test -d $VIRTUAL_ENV || virtualenv $VIRTUAL_ENV
It se
The ||
is the OR condition. Hence, this will test if $VIRTUAL_ENV
directory exists. If not, it will run virtualenv $VIRTUAL_ENV
.
Other examples:
$ test -d /tmp || echo "yes"
$
$ test -d /tmpblabla || echo "this dir does not exist"
this dir does not exist
$ test -d /tmp && echo "/tmp exists" || echo "yes"
/tmp exists