Git: Remove committed file after push

If you want to remove the file from the remote repo, first remove it from your project with –cache option and then push it:

git rm --cache /path/to/file
git commit -am "Remove file"
git push

(This works even if the file was added to the remote repo some commits ago) Remember to add to .gitignore the file extensions that you don’t want to push.

bash: perform mathematical operations on strings

If VAR1 and VAR2 are strings having integer values like:
VAR1=”12″

VAR2=”2″

Then mathematical operations can be performed on it as below:
VAR3=$(echo “$VAR1 $VAR2” | awk ‘{print $1+$2}’)

OR you can also use:
VAR3=$(awk ‘{print $1+$2}’ <<<“$VAR1 $VAR2”)