Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
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 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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