<br>Hi <br> thanks for the reply <br> i have done  what you have said, created a foo.sh file in my root directory and i got the out put as:<br><span style="font-weight: bold;"><span style="font-weight: bold;"><br></span>foo.sh
:</span><br>FOO=`cd "\`echo \"$0\" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`";cd ..;pwd`<br>echo "$FOO"<br><br>actually the command you gave me <span style="font-weight: bold;">"/bin/sh  
foo.sh"</span> didnt  work i typed it as<span style="font-weight: bold;"> /bin/sh "foo.sh".</span> <br><br><span style="font-weight: bold;">output :</span><br style="font-weight: bold;"><span style="font-weight: bold;">
/home</span><br style="font-weight: bold;"><div><span class="gmail_quote"><br>i changed the foo.sh file location to ~/gccxml-build and run the process<br><br>output:<br>/home/pradeepd<br><br>actually i doent have much knowledge in unix. can you help.
<br>thanks in advance:<br>On 8/21/07, <b class="gmail_sendername">Brad King</b> <<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
pradeep kumar wrote:<br>> Command: /bin/sh<br>> "/home/pradeepd/gccxml/GCC/config_cmake/gcc_platform.sh"<br>> "/home/pradeepd/gccxml-build/GCC/config_cmake/gcc_platform.cmake"<br>> "usr/bin/cmake "
<br>><br>> Output:<br>> /home/pradeepd/gccxml/GCC/config_cmake/gcc_platform.sh:<br>> /home/pradeepd/gccxml/GC: bad interpreter: No such file or directory<br>[snip]<br>> File: gcc_plarform.sh<br>><br>> GCC_SOURCE_DIR=`cd "\`echo \"$0\" | sed -n
<br>> '/\//{s/\/[^\/]*$//;p;}'\`";cd ..;pwd`<br><br>This is very strange.  No one has ever had a problem with this script<br>before.  Try creating a file "foo.sh" with the contents<br><br>FOO=`cd "\`echo \"$0\" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`";cd ..;pwd`
<br>echo "$FOO"<br><br>and then run "/bin/sh foo.sh".  What happens?<br><br>-Brad<br></blockquote></div><br>