Hello,
just came across a strange and irritating side effect of echo today, while `tr`ing a C source file and echoing the result into another. Just after
Code:
string=`cat boot.c | tr '\n' ' '`
an extract of $string looks like this (courtesy of bash -x):
Code:
initTcbs(); /**************** SSI ****************/ /*Thread control block pointer
which is correct, BUT if i try to echo it... the result is this (same part as above):
Code:
initTcbs(); /bin /boot /cdrom /dev /etc /home /initrd.img /lib /lost+found /media /mnt /opt /proc /root /sbin /selinux /srv /sys /tmp /usr /var /vmlinuz SSI home docs/ openrg/ programming/ prints/ /*Thread control block pointer
As you can see /* (start of comment) and * (after "SSI") will cause echo to print my root dir and my $PWD (desktop in this case), respectively. But not the "/*Thread control block pointer" comment which follows.
What the heck is wrong with me?