Showing posts with label techincal. Show all posts
Showing posts with label techincal. Show all posts

Wednesday, July 15, 2009

Exporting shell environments via scripts

More of a technical one this is.

Recently, while creating a release package, i was facing a problem which, after some tries, I finally figured out the solution for. So here it is.


The need was to setup an environment by running a script, after which application can be run seamlessly. One of the entries in the script looked like =>

export LD_LIBRARY_PATH= $(pwd)/../lib:$LD_LIBRARY_PATH


The step was needed as the the package did install libraries in a separate path than the default one.

However even after i executed the script as " ./load.sh" , running applications still gave me error:

":error while loading shared libraries: : cannot open shared object file: No such file or directory".

I was able to set the path inside the script and running the application from within the script worked, but from the terminal (parent process) which executed the script (child process) i was not able to set the env. paths.

The reason for the failure was that the settings done by the child process are not visible in the parent process.

Solution-> Execute script as part of parent process instead of forking, as:

. ./load.sh OR source ./load.sh


Happy shell scripting :)

Monday, June 09, 2008

File converter

Before you start frowning and saying what gr8 stuff is this, my explanation: arre bhai free of cost hai aur kafi accha hai cool [ I wish i get paid for such publicity razz ]

So herez this one file convertor that works for linux and converts any file format to any....any matlab ..any . yakeen nahi hota ..toh yeah dekho

File Converter is free of cost web based utility. Quite good and i have really felt its importance when my boss suddenly asked me to give a document in a "abc" format when i had taken so much pains (yes ..for a change) and did the document in "xyz" format.

Do have a look :).