Modifying the “PATH” variable in MAC

This is probably the most important thing one can do in a UNIX based system- Modify the PATH variable.

I recently installed Libreoffice on my mac for using its command line tools. It was working fine in the applications folder and showing up on spotlight as well as dock but the command line tool was not working

After some time , I figured that in Linux, I used “libreoffice ….” but in Mac I had to use “soffice…”. soffice command was not directly available to me on terminal and I had to specify the whole path to use it:

/Applications/LibreOffice.app/Contents/MacOS/soffice –help

To use soffice without the whole path, I modified my PATH variable :

nano ~/.bash_profile

(create this file using touch ~/.bash_profile if your system doesn’t have one!!)

Include the lines:

export PATH=”/Applications/LibreOffice.app/Contents/MacOS:$PATH”

Save it and enter the command:

source ~/.bash_profile

And wallah ! The Path variable is modified and we can now use soffice directly in command line.

soffice –help

This way, we can include any application in command line.

Hope it helps.

Installing and setting up GIT

INSTALLING GIT
Installing from Source:
In short, on a Unix-based system, you can download the Git source code from the Git Download Page, and then run
something along the lines of :

$ make prefix=/usr all ;# as yourself
$ make prefix=/usr install ;# as root

You will need the expat, curl, zlib, and openssl libraries installed – though with the possible exception of expat, these will normally already be there.

Linux
If you are running Linux, you can likely install Git easily via your native package management system:

$ yum install git-core
$ apt-get install git-core

Mac 10.4:
In both Mac 10.4 and 10.5, you can install Git via MacPorts, if you have that installed. If not, you can install it from here.
Once MacPorts is installed, all you should have to do is:

$ sudo port install git-core

If you prefer to install from source, these articles may be helpful:
Article: Installing Git on Tiger
Article: Installing Git and git-svn on Tiger from source

Mac 10.5
With Leopard, you can also install via MacPorts, but here you have the additional option of using a nice installer, which you can download from here: Git OSX Installer
If you prefer to install it from source, these guides may be particularly helpful to you :
Article: Installing Git on OSX Leopard
Article: Installing Git on OS 10.5

SETUP AND INITIALIZATION
Git Config
The first thing you’re going to want to do is set up your name and email address for Git to use to sign your commits.

$ git config –global user.name “Rushabh hathi”
$ git config –global user.email “rushabhhathi@gmail.com”

That will set up a file in your home directory which may be used by any of your projects. By default that file is ~/.gitconfig
and the contents will look like this:
[user]
name = Rushabh Hathi
email = rushabhhathi@gmail.com

If you want to override those values for a specific project (to use a work email address, for example), you can run the git config command without the –global option while in that project. This will add a [user] section like the one shown above to the .git/config file in your project’s root directory.