I wrote the following script to kick out logged in users to Asterisk. (FreePBX deviceanduser mode)
Here is a sample on running a service to startup in centos:
regexxer is a nifty GUI search/replace tool featuring Perl-style regular expressions. If you need project-wide substitution and you’re tired of hacking sed command lines together, then you should definitely give it a try.
Here is an example on how to get the process ID of an application in bash script
The Standard UNIX File Descriptors – Standard Input (stdin), Standard Output (stdout), and Standard Error (stderr). Bash and other modern shell provides I/O redirection facility. There are 3 default standard files (standard streams) open:
[a] stdin – Use to get input (keyboard) i.e. data going into a program.
[b] stdout – Use to write information (screen)
[c] stderr – Use to write error message (screen)
You can look at /usr/include/unistd.h if you forget them:
/* Standard file descriptors. */ #define STDIN_FILENO 0 /* Standard input. */ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. */
In this post we have some basic scripting samples collected from here and there. It must be straightforward and to the point, way better than going through pages of manuals looking for a clue. Check the resources at the end