Одинарные кавычки здесь не работают, так как тогда ваша переменная не будет раскрыта. Если вы уверены, что переменная для вашего пути очищена, самое простое решение — просто добавить кавычки вокруг полученного расширения, как только оно появится в новой оболочке bash:
sudo bash -c "cd \"$myvar\""
Похоже, ваша система использует udev от systemd.
Итак, давайте перейдем к справочной странице этой службы (systemd -udevd.service (8)):
The behavior of the daemon can be configured using udev.conf(5), its command line options,
environment variables, and on the kernel command line, or changed dynamically with udevadm
control.
И далее:
KERNEL COMMAND LINE
Parameters starting with "rd." will be read when systemd-udevd is used in an initrd.
udev.log-priority=, rd.udev.log-priority=
Set the log level.
udev.children-max=, rd.udev.children-max=
Limit the number of events executed in parallel.
udev.exec-delay=, rd.udev.exec-delay=
Delay the execution of RUN instructions by the given number of seconds. This option might
be useful when debugging system crashes during coldplug caused by loading non-working
kernel modules.
udev.event-timeout=, rd.udev.event-timeout=
Wait for events to finish up to the given number of seconds. This option might be useful
if events are terminated due to kernel drivers taking too long to initialize.
net.ifnames=
Network interfaces are renamed to give them predictable names when possible. It is enabled
by default; specifying 0 disables it.
Так что, возможно, вы могли бы попытаться добавитьudev.event-timeout=10
(или то же самое с префиксом rd.
, если проблема связана с фазой initrd )в командной строке вашего ядра.