I have cut out a piece of my Bash script that I cannot get to function as it should. I want to copy the content of the folder gmp-5.0.4 into gcc-4.6.3/gmp these packages have been unpacked earlier in the script:
GMP_PACKAGE=ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.4.tar.bz2
GCC_PACKAGE=http://mirrors.kernel.org/gnu/gcc/gcc-4.6.3/gcc-core-4.6.3.tar.bz2
copy_math_libraries()
{
LOCATION="$1"
mkdir "$LOCATION/gmp"
cp -v -r "$PACKAGES/`basename $GMP_PACKAGE .tar.bz2`/*" "$LOCATION/gmp"
}
copy_math_libraries "$PACKAGES/`basename $GCC_PACKAGE .tar.bz2 | sed s/core-//`"
When running the script with set -x I get the following output:
++ cp -v -r '/home/klaus/toolchain/packages/gmp-5.0.4/*' /home/klaus/toolchain/packages/gcc-4.6.3/gmp
cp: cannot stat `/home/klaus/toolchain/packages/gmp-5.0.4/*': No such file or directory
If I open another shell and run the exact same command manually everything works as it should:
cp -v -r /home/klaus/toolchain/packages/gmp-5.0.4/* /home/klaus/toolchain/packages/gcc-4.6.3/gmp
Any suggestions are welcome.
copy_math_librariesgets called?set -xoutput in your command? Me neither.