Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

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

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

Regards

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.