move the duplicated args into a local array local grub args  p  efi boot part gpt fat ext  hfs hfsplus normal boot chain configfile linux sudo grub  mkimage  o x efi  o flags to  efi boot bootx efi grub args 