steev@keuhi ~/repos/steev/sys-apps/hal $ bash -c 'a=/path/to/somedir;b=/path;c=${a##${b/}}' bash: ${b/}: bad substitution *** glibc detected *** bash: free(): invalid pointer: 0x1175da69 *** ======= Backtrace: ========= /lib/libc.so.6[0x55177ee2] /lib/libc.so.6(cfree+0x87)[0x55179b97] bash[0x116d7b64] bash[0x116d8879] bash[0x116d8a0d] bash[0x116d8a5e] bash[0x116d8b2a] bash[0x116d496d] bash[0x116d5e6d] bash[0x116d6f81] bash[0x116d8879] bash(expand_string_assignment+0x82)[0x116d8d22] bash[0x116d1524] bash[0x116d1901] bash[0x116d7f5e] bash[0x116bd82c] bash(execute_command_internal+0x687)[0x116bc0e7] bash[0x116bb833] bash(execute_command_internal+0xc4b)[0x116bc6ab] bash(parse_and_execute+0x2a6)[0x116f4186] bash[0x116a9dad] bash(main+0xc0d)[0x116ab0ad] /lib/libc.so.6(__libc_start_main+0xe0)[0x55128ff0] bash[0x116a9191] ======= Memory map: ======== 11690000-1173c000 r-xp 00000000 08:03 2389065 /bin/bash 1173c000-1173d000 r--p 000ab000 08:03 2389065 /bin/bash 1173d000-11743000 rw-p 000ac000 08:03 2389065 /bin/bash 11743000-11779000 rw-p 11743000 00:00 0 [heap] 54e00000-54e21000 rw-p 54e00000 00:00 0 54e21000-54f00000 ---p 54e21000 00:00 0 54f94000-54f9e000 r-xp 00000000 08:03 585841 /lib/libgcc_s.so.1 54f9e000-54f9f000 r--p 00009000 08:03 585841 /lib/libgcc_s.so.1 54f9f000-54fa0000 rw-p 0000a000 08:03 585841 /lib/libgcc_s.so.1 54fb0000-54ff2000 rw-p 54fb0000 00:00 0 54ff2000-55031000 r--p 00000000 08:03 3541702 /usr/lib/locale/en_US.utf8/LC_CTYPE 55031000-55032000 r--p 00000000 08:03 3591652 /usr/lib/locale/en_US.utf8/LC_NUMERIC 55032000-55112000 r--p 00000000 08:03 3595074 /usr/lib/locale/en_US.utf8/LC_COLLATE 55112000-55113000 rw-p 55112000 00:00 0 55113000-5523d000 r-xp 00000000 08:03 3665591 /lib/libc-2.6.1.so 5523d000-5523f000 r--p 0012a000 08:03 3665591 /lib/libc-2.6.1.so 5523f000-55240000 rw-p 0012c000 08:03 3665591 /lib/libc-2.6.1.so 55240000-55243000 rw-p 55240000 00:00 0 55243000-55245000 r-xp 00000000 08:03 3665746 /lib/libdl-2.6.1.so 55245000-55246000 r--p 00001000 08:03 3665746 /lib/libdl-2.6.1.so 55246000-55247000 rw-p 00002000 08:03 3665746 /lib/libdl-2.6.1.so 55247000-55280000 r-xp 00000000 08:03 2289568 /lib/libncurses.so.5.6 55280000-55287000 r--p 00039000 08:03 2289568 /lib/libncurses.so.5.6 55287000-55289000 rw-p 00040000 08:03 2289568 /lib/libncurses.so.5.6 55289000-5528a000 rw-p 55289000 00:00 0 5528a000-5528b000 r--p 00000000 08:03 3593048 /usr/lib/locale/en_US.utf8/LC_TIME 5528b000-5528c000 r--p 00000000 08:03 3595075 /usr/lib/locale/en_US.utf8/LC_MONETARY 5528c000-5528d000 r--p 00000000 08:03 3596090 /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES 5528d000-5528e000 r--p 00000000 08:03 3596096 /usr/lib/locale/en_US.utf8/LC_PAPER 5528e000-5528f000 r--p 00000000 08:03 3596097 /usr/lib/locale/en_US.utf8/LC_NAME 5528f000-55290000 r--p 00000000 08:03 3596099 /usr/lib/locale/en_US.utf8/LC_ADDRESS 55290000-55291000 r--p 00000000 08:03 3596101 /usr/lib/locale/en_US.utf8/LC_TELEPHONE 55291000-55292000 r--p 00000000 08:03 3596103 /usr/lib/locale/en_US.utf8/LC_MEASUREMENT 55292000-55299000 r--s 00000000 08:03 3392739 /usr/lib/gconv/gconv-modules.cache 55299000-5529a000 r--p 00000000 08:03 3596104 /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION 5529a000-5529b000 r-xp 5529a000 00:00 0 [vdso] 5529b000-552b5000 r-xp 00000000 08:03 3665763 /lib/ld-2.6.1.so 552b5000-552b6000 r--p 00019000 08:03 3665763 /lib/ld-2.6.1.so 552b6000-552b7000 rw-p 0001a000 08:03 3665763 /lib/ld-2.6.1.so 5f3bd000-5f3d3000 rw-p bffea000 00:00 0 [stack] 71690000-7173c000 r-xp 00000000 08:03 2389065 /bin/bash b4f94000-b4f9e000 r-xp 00000000 08:03 585841 /lib/libgcc_s.so.1 b5113000-b523d000 r-xp 00000000 08:03 3665591 /lib/libc-2.6.1.so b5243000-b5245000 r-xp 00000000 08:03 3665746 /lib/libdl-2.6.1.so b5247000-b5280000 r-xp 00000000 08:03 2289568 /lib/libncurses.so.5.6 b529a000-b529b000 r-xp 5529a000 00:00 0 [vdso] b529b000-b52b5000 r-xp 00000000 08:03 3665763 /lib/ld-2.6.1.so Aborted