Auto-start Sphinx (searchd) after reboot Linux

By default, after you install and configure Sphinx, you will find that once your OS restarts, search will not be working. That is because searchd is not setup to auto start. The following will solve that problem.

Create file /etc/init.d/searchd.

Copy the following into searchd.

Add execute to the file

Register with auto start

Bash script list HTML files and write first line

I wrote a bash shell script that lists all HTML files “*.html” in a directory and writes the first line of each HTML-file to a file called File_Heads:

Note: When a command is inside backward quotes ` its output is substituted in place of the back-quotes.

Bash tutorial 101

I recently came across a few comments about bash scripting and figured I would share a simple tutorial for creating your first bash script.

1. Hello World Bash Shell Script

First you need to find out where is your bash interpreter located. Enter the following into your command line:

Open up you favorite text editor and a create file called hello_world.sh. Insert the following lines to a file:
NOTE:Every bash shell script in this tutorial starts with shebang:”#!” which is not read as a comment. First line is also a place where you put your interpreter which is in this case: /bin/bash.
Here is our first bash shell script example:

Navigate to a directory where your hello_world.sh is located and make the file executable:

Now you are ready to execute your first bash script:

Edit .bashrc or .bash_profile

First, we need to open .bashrc or .bash_profile

You can now add/edit your profile