What alternatives are there for “ readlink -e”
问题 I use a makefile which in order to create a library uses a .pc file which looks like this current_path=`readlink -e .` cat > lib/libmy.pc << EOM prefix=$current_path includedir=\${prefix}/inc libdir=\${prefix}/lib Name: my Description: My library Version: 1.0 Cflags: -I\${includedir} Libs: -L\${libdir} -lmy Libs.private: -lm EOM The problem is that on mac the -e flag doesn't work (even I installed coreutils). I there a method to replace the flag? 回答1: The most portable way I could find: