Hello,

I'm trying to write an expression that will be true if either one of two files 
are present. The expression must return true if either ntldr or bootmgr is 
present on the first partition of the first drive. If either one is present I 
want to boot to windows on that partition.

So I tried:

if [ -e (hd0,msdos1)/ntldr -o -e (hd0,msdos1)/bootmgr ] ; then
   #do stuff to boot windows

This works great if ntldr is present. But if ntldr is NOT present, and bootmgr 
is present, then the test fails. So I reversed the order:

if [ -e (hd0,msdos1)/bootmgr -o -e (hd0,msdos1)/ntldr ] ; then
   #do stuff to boot windows
        
Which works if bootmgr is present, but not for ntldr.

In other words, it appears that combining expressions with or operation does 
not work. Only the first operand is used. Is the or operation implemented?

I guess I can change separate the expression into two separate if statements.

Thanks,
Kent Loving

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to