Maurice Lombardi wrote:
Maurice Lombardi a écrit :
Frank Heckenbach a écrit :
Maurice Lombardi wrote:
! ADD_RTS_PARENT_DIR = sed -e 's,-B\([^/]\),-B../../\1,g;s,^\([^/][^ ]*\),../../\1,'` ! ADD_RTS_PARENT_DIR = sed -e 's,-B\([^/][^:]\),-B../../\1,g;s,^\([^/][^:][^ ]*\),../../\1,'`
I need a great supply of asprin nearby when trying to decipher those sed scripts
Got the asprin. The logics is (extracted from rx.info)
For example, the character `*' is used to indicate that the preceeding element of a regexp may be repeated 0, 1, or more times.
0 is the problem. It does not excludes the case where : is the second character.
You're right, I overlooked the `*'. But I still don't see what the `[^ ]*' was for -- after all, it's inserted back in the same place, so it's irrelevant whether the parentheses match a few spaces more or less. So let's try it simply without the `*': ADD_RTS_PARENT_DIR = sed -e 's,-B\([^/][^:]\),-B../../\1,g;s,^\([^/][^:]\),../../\1,'
And IIRC the + which would mean at least 1 is not understood by all sed's (notably the djgpp one whe had sometimes ago when I tried to figure that out.
Sun's sed doesn't understand it, either. But since `x+' is equivalent to `xx*', that's easy to work around. Not so with `|' :-(but that's OT here)...
May be a more recent release ...)
A recent GNU sed on DJGPP should understand it (the regex syntax is not system dependent, after all)... However, note that `+' is extended regex syntax. In a basic regex (which is what sed expects), it's `\+'. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html