Tiny Core Linux
Tiny Core Base => TCB Bugs => Topic started by: littlebat on March 10, 2012, 01:03:59 AM
-
I have found this bug exist in Tinycore V3.7.1 and the current Tinycore V4.3.
if [ -e "/proc/$(</var/run/rebuildfstab.pid)" ]; then
touch /var/run/rebuildfstab.rescan 2>/dev/null
exit
fi
I think the purpose of this condition test is detecting if an instance of this script has already been running, if so, write a "rescan" flag to cause the already running script recan at the end of it, and exit the second script instance.
"$(</var/run/rebuildfstab.pid)" can't get the first running script's pid directory under /proc, and I don't know the usage of something like "$(<filename)". But if I write any string into "/var/run/rebuildfstab.pid", the "if []" condition is always "true".
I can get this work with "$(cat /var/run/rebuildfstab.pid)".
-
It's shorthand syntax to avoid executing cat, ie to read the file in the current shell process. Seems it's indeed not working properly in ash, though.
-
Suggested change accepted. Thanks!
-
It's shorthand syntax to avoid executing cat, ie to read the file in the current shell process. Seems it's indeed not working properly in ash, though.
Yes, "$(<filename)" can't work in /bin/sh->/bin/busbox, /bin/ash->/bin/busbox in Tinycore Linux, can't work in /bin/sh->/bin/dash in Debian Squezze. It can work in bash(tested in some distros).