I have written a bash script to automate cross-compiling an OpenCV program:

echo "Compiling started for: $1"
if [[ $1 == *.c ]]
    gcc -ggdb `pkg-config --cflags opencv` -o `basename $1 .c` $1 `pkg-config --libs opencv`;
elif [[ $1 == *.cpp ]]
    g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`;
    echo "Only c or c++ files"
echo "Output: ${1%.*}"

But now I noticed that there does not exist a bashrc at the Angstrom distribution. So what can I do?

  • Make sure to put #!/bin/bash at the top of the script (a shebang line), otherwise your script might be executed in a different shell. – Gilles 'SO- stop being evil' Nov 3 '12 at 23:37

Let me clarify something. .bashrc is just for configuring your bash interpreter. You can set things like, how should your prompt look etc... It does not mean anything special if it does not exist, you can just create it, and if its a proper linux it will be read by default.

However you can check what kind of interpretation enviorment your user is in by taking a lookg on /etc/passwd, on the line with your user, there will be what it is like: /bin/bash

If for some reason, bash is not your default shell, you can read this blogpost for setting it to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.