I am new to ubuntu, and tried to use OpenFOAM Installation worked OK; after that I copy-pasted the very first example, worked also OK. but I cannot understand how.
There are funny commands like:
mkdir -p $FOAM_RUN
This creates the folder structure /home/username/OpenFOAM/username-2.3.1/run
Or
cp -r $FOAM_TUTORIALS $FOAM_RUN
This copies the tutorials in the above mentioned folder
What does the sign $
do?
These commands work when copy-pasted, but I want understanding them and being able to use them later on.
Best Answer
The name of a variable is a placeholder for its value, the data it holds. Referencing (retrieving) its value is called variable substitution. The $ sign helps us to get the value.
We define variable1 with a value 23:
To print the name of the variable (echo is just like a print function in the terminal):
To print the actual value saved in the variable