再请教几个问题:
1、条件语句很长,为了增强代码可读性,如何分行?
如:if [ A -a B -a C -o D -a E -a F -o G -a H -a I -o J -a K -a L ];
2、if [ "$grub_platform" = "pc" ]; then
详情回复
发表于 2020-8-2 11:01
再请教几个问题:
1、条件语句很长,为了增强代码可读性,如何分行?
如:if [ A -a B -a C -o D -a E -a F -o G -a H -a I -o J -a K -a L ];
2、if [ "$grub_platform" = "pc" ]; then
probe --set=bootable -b ${device};
if regexp 'bootable' "${bootable}"; then 可以找到UD区;
如果想跳过UD区,应如何增加条件?
试过:if ! test "${device}" = "(hd0,1)" ;then
if ! test "${device} = (hd0,1)" ;then
if test "${device}" != "(hd0,1)" ;then
if test "${device} != (hd0,1)" ;then
似乎都不可以。
谢谢!