This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] testsuite_flags absolute path fix
On May 23, 2001, Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> wrote:
> dir=`case $dir in /*) echo $dir ;; *) echo \`cd $dir; ${PWDCMD:-pwd}\` ;; esac`
> Thoughts, comments?
Are don't nest properly in all shells. :- isn't portable. Instead, use:
case $dir in
[\\/$]* | ?:[\\/]*) ;;
*) dir=`cd "$dir" && ${PWDCMD-pwd} || echo "$dir"` ;;
esac
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me