Tom Schneider wrote:
Dear Maurice:
I noticed your complex expression:
The relevant part of the output is (with some air interspersed)
cd p/rts && c:/djgpp/bin/make.exe CC="`echo c:/djgpp/gnu/gcc-2.952/build.djg/gcc /xgcc -Bc:/djgpp/gnu/gcc-2.952/build.djg/gcc/ -Bc:/djgpp/i586-pc-msdosdjgpp/bin/ -Ic:/djgpp/i586-pc-msdosdjgpp/include' ' | sed -e 's,-B([^/][^:]),-B../../\1, g;s,^([^/][^:]*),../../\1,'`" PC="`echo ./xgpc -B./' ' | sed -e 's,-B([^/][^: ]),-B../../\1,g;s,^([^/][^:]*),../../\1,'`" SHELL="c:/djgpp/bin/bash.exe" CFL AGS="-O2" AR="ar" AR_FLAGS="rc" RANLIB="ranlib" RANLIB_TEST="[ -f ranlib ] || ( [ "i586-pc-msdosdjgpp" = "i586-pc-msdosdjgpp" ] && [ -f /usr/bin/ranlib -o -f /b in/ranlib ] )" RTSFLAGS="" DESTDIR="../.." all
Even with the space it is hard to get through!
So I thought of mentioning a trick I use: the backslash to break the lines into logical units:
cd p/rts && c:/djgpp/bin/make.exe CC="`echo c:/djgpp/gnu/gcc-2.952/build.djg/gcc /xgcc -Bc:/djgpp/gnu/gcc-2.952/build.djg/gcc/ -Bc:/djgpp/i586-pc-msdosdjgpp/bin/ -Ic:/djgpp/i586-pc-msdosdjgpp/include' ' |\ cat |\ sed -e 's,-B([^/][^:]),-B../../\1, g;s,^([^/][^:]*),../../\1,'`" PC="`echo ./xgpc -B./' ' |\ cat |\ sed -e 's,-B([^/][^: ]),-B../../\1,g;s,^([^/][^:]*),../../\1,'`" SHELL="c:/djgpp/bin/bash.exe" CFLAGS="-O2" AR="ar" AR_FLAGS="rc" RANLIB="ranlib" RANLIB_TEST="[ -f ranlib ] || ( [ "i586-pc-msdosdjgpp" = "i586-pc-msdosdjgpp" ] && [ -f /usr/bin/ranlib -o -f /b in/ranlib ] )" RTSFLAGS="" DESTDIR="../.." all
Well, that's not much better (yet) but the idea is to do things like this:
cat my.file |\ tr -d 0-9 |\ sort |\ uniq |\ sed -e "s/this/that/g" |\ cat > my.result
The nice thing about this method is that one can easily see the steps, and it is easy to rearrange and modify.
Unfortunately, that's the make output and make swallows /newline in variables (and most of the command above is stored in variables)..
Frank