Skip to content

Conversation

@I-Iege
Copy link

@I-Iege I-Iege commented Sep 9, 2025

Add p variable to handle cases where partitions created with p1 p2 naming instead of 1 2

print_color "Create MS-DOS MBR..." "blue"
sudo parted -s ${DEVICE} mklabel msdos > /dev/null 2>&1
print_color "Partitioning..." "blue"
sudo parted -s ${DEVICE} mkpart primary fat32 1MiB 513MiB > /dev/null 2>&1
Copy link
Author

@I-Iege I-Iege Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you use tabs?


format_partitions()
{
p=$(( ${#DEVICE} -gt 3 ? "p" : "" ))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is bash syntax the shell syntax would be:
p=$([ ${#DEVICE} -gt 3 ] && "p" || "")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant