Archive

Archive for the ‘Scripts’ Category

Find words in files in linux

March 7th, 2011 No comments

After wanting to find text inside of files in Ubuntu I ran across a nice little post. They way it was described to do it works great.  It uses the grep command.

Say you want to find some text called “my_function” in your scripts folder located at the /home/michael/scripts/ directory. Simply run the following command:

grep -i -n -r 'my_function' /home/michael/scripts/

Here is what is happening:
grep is function name to search a pattern in files
-i means ignore case
-n means output line number
-r search recursively

This makes it easy to edit the files with vim, and then jump straight to the line that you needed to edit.

Categories: Scripts Tags: , , ,

Pop-up notification from the command line

August 12th, 2010 No comments

pop-up notifitacionI was looking for a way to tap into the pop-up bubbles that Ubuntu displays notifications in. I wanted to be able to have some scripts run and notify me when they were done. After searching for a little while I finally ran across a post on www.barregren.se.  He goes into pretty good detail about the things that you can do with the notify program.  Read more…

Categories: Scripts Tags: , , ,

Perl CPAN easy install

August 10th, 2010 No comments

I ran into an interesting little bit of information as I was working on a perl project.  I was trying to do some XML manipulation within perl, and I ran across the techrepublic.com that had an article about XML::Simple, which is an extension for perl.

While reading through their article they talked about installing XML::Simple. I was thinking here come the whole procedure download, make, make install, etc., but that wasn’t the case. Apparently you can install items from CPAN very easily from the command line. Here is all it took to install the XML::Simple extension.

perl -MCPAN -e shell

After running that I was in a CPAN shell with a command prompt that looked like.

CPAN[1]>

Then to install the XML::Simple all I had to do was run the following.

install XML::Simple

Speaking of simple. Now I have XML::Simple, and a new simple way to install extensions from CPAN.

Categories: Scripts Tags: , ,