Tiny Core Base > Micro Core

output of hostname -i has an space at the end

(1/1)

tm:
Hey,

i'm using the output of hostname -i for a case and was wondering why it always gos to the default case.
It was the space at the end as you can see

~$ echo ">$(hostname -i)<"
>172.27.45.6 <

or
~$ hostname -i|od -c
0000000   1   7   2   .   2   7   .   4   5   .   6      \n
0000015

solved
hn=$(hostname -i)
hn2=${hn%% *}
and now in hn2 there are no more spaces.
~$ echo ">$hn2<"
>172.27.45.6<

i am using tc 2.1 and 4.3

kind regards
tm

gutmensch:
thx, seems to be a busybox error, reported upstream.

Navigation

[0] Message Index

Go to full version