On 28 Dec 2005, at 23:21, Martin Costabel wrote:
Well, then here is the longer version of the reasons for my guess:
In my version of /usr/sbin/gcc_select, there are the two lines
actual_ver="`cc -v 2>&1 | grep -i 'gcc version'`"
current_cc="`echo \"$actual_ver\" | sed -e 's/.*gcc version \([^ ]
*\).*/\1/'`"
If you execute this (in /bin/sh) and then do
echo $current_cc
you should get "4.0.1" as a result. According to what you said
before, it looks like you are instead getting the result "gcc
version 4.0.1 (Apple Computer, Inc. build 5247)". This is the value
of $actual_ver. That is, the "sed -e ..." command is not doing
anything. I am trying to understand how this is possible, but this
is difficult from the distance. Maybe you can find it out yourself.
I think I'm a little closer, but still in the dark. When I run
$ actual_ver="`cc -v 2>&1 | grep -i 'gcc version'`"
$ echo $actual_ver
gcc version 4.0.1 (Apple Computer, Inc. build 5247)
Now you can't see this, but bash is colouring 'gcc version' red. I
didn't think anything of it, but if I try
$ echo "gcc version 4.0.1 (Apple Computer, Inc. build 5247)" | sed -e
's/.*gcc version \([^ ]*\).*/\1/'
4.0.1
I reckon that there must be some control character spat out by cc -v
which is screwing with the regexp?
Duncan
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Fink-beginners mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-beginners