I have a variable with a directory path. If I echo
its content it outputs the right path, but if I try to cd
it doesn't and it seems to delete the /home/user/
from the path:
[user@project]$ echo $PROJECT_DELIVERY
/home/user/projects/ws/project/delivery/project_name_0.1.0
[user@project]$ cd $PROJECT_DELIVERY
: No such file or directoryuser/projects/ws/project/delivery/project_name_0.1.0
This is the content of printf %s "$PROJECT_DELIVERY" | xxd
[a27503408@ded30325 install]$ printf %s "$PROJECT_DELIVERY" | xxd
0000000: 2f68 6f6d 652f 6132 3735 3033 3430 382f /home/user/
0000010: 7072 6f6a 6563 7473 2f61 7332 3530 2f41 projects/as250/A
0000020: 5332 3530 5f4d 3135 3533 5f54 4d54 432f S250_M1553_TMTC/
0000030: 6465 6c69 7665 7279 2f41 5332 3530 5f4d delivery/AS250_M
0000040: 3135 3533 5f54 4d54 435f 302e 312e 300d 1553_TMTC_0.1.0.
Any idea what could be causing this behavior? I'm using bash 4.1.2(1)
printf %s "$PROJECT_DELIVERY" | xxd
? – choroba Feb 13 '18 at 10:53\r
) at the end or in the very beginning. – Kusalananda Feb 13 '18 at 11:00dos2unix
missing somewhere ... – Archemar Feb 13 '18 at 11:01