asb / raspi-config

Configuration tool for the Raspberry Pi. Now maintained at https://github.com/RPi-Distro/raspi-config
Other
263 stars 328 forks source link

busybox compatible prefix removal #74

Open MakiseKurisu opened 5 years ago

MakiseKurisu commented 5 years ago

When running this script under busybox's sh/ash, prefix removel works from the beginning of the variable:

# ROOT_PART=$(readlink /dev/root);PART_NUM=${ROOT_PART#mmcblk0p};echo $PART_NUM
/dev/mmcblk0p2
# ROOT_PART=$(readlink /dev/root);PART_NUM=${ROOT_PART#/dev/mmcblk0p};echo $PART_NUM
2