Linux User Group of Mauritius Promoting open source software in our beautiful island

22Mar/150

Bash source file

Posted by Ish

While I had no particular reason why to code it in Perl or Python, I ended writing my scripts in Bash on this Sunday afternoon. No huge tasks were meant to be executed, just some database reading. However, all of the short scripts would be using common variables, namely regarding the DB credentials. Sourcing variables from an external file could be achieved using . filename or source filename.

A little heck comes when passwords containing special characters such as $ < > [] {} ` ' " | & ; * ? are used. In your source file you need to escape each of those characters using a backslash symbol.

For example we could have a configuration file db.conf as follows:

HOST=localhost
DBNAME=testdb
DBUSER=user001
DBPASS=!p@ssw0rd$

Now, let’s get the variables as follows:

#!/bin/bash
. db.conf
echo $DBPASS

Copy the above in a file named getSQLPass.sh and we run it.

bash-source-file

The backslash symbols do not get printed.

The post Bash source file appeared first on HACKLOG.

Tagged as: No Comments
19Mar/150

Ubuntu 15.04 Vivid Vervet Release Party #DevConMru

Posted by Ish

The release of Ubuntu 15.04 Vivid Vervet is coinciding with Developers Conference 2015. We’re thus proudly having our release party during the event. Typically, all geek stuffs, that is hackathons, demos, installfests will run Flying Dodo, Bagatelle. Ubuntu release party is scheduled for Thursday 23rd April and I shall be there a whole, hopefully. So… Bring it ON and let’s have some Ubuntu fun.

Ubuntu Mauritius

ubuntu-mauritius-220Ubuntu Mauritius is a group comprising of Ubuntu enthusiasts who seek to promote the use of Ubuntu and free open source software. The group comprises of professionals as well as college & university students, who dedicate their time to plan and organize events around the island.

Should you wish to join the league, catch us on Launchpad. We’re reachable via our mailing published on our Launchpad page. We also have an event page on the Ubuntu LoCo Team Portal.

Meanwhile let’s just spread some Linux Love through #Ubuntu #Mauritius #DevConMru hashtags on social networks. Those who are on Facebook, feel free to use the following as FB Cover.

ubuntu-cover

The post Ubuntu 15.04 Vivid Vervet Release Party #DevConMru appeared first on HACKLOG.