linux shell intro

Started by ggnfs000, January 13, 2017, 12:01:54 PM

Previous topic - Next topic

ggnfs000

linux shell intro

With increasing need to do a shell scripting, I decided to take some  notes on shell scripting specially for sed using regexp expression. It  turns out the regexp expression syntax used in shell script is much  different than python regexp. In addition, in this part of the blog, I also decide to note the syntaxes for various linux shell control flows, variable declaration and assignment, operator syntaxes.

Here are some starting notes:

I  am taking examples based on two variables VAR1 is the string on which  regexp is operating on and VAR2 is the result of the regexp operation.

From the example below the cat $var2's value will be printed and piped to sed expression.
From  the output of cat, <searching string> is searched and replaced by  <replacement string>. s/ signifies it is a substitution operaion:


var2=`cat $var2 | sed -r 's/<search string>/<replacement string>/'`




Source: linux shell intro

icecream-guy

and which shell is the shell of choice ?

Bourne
C shell
Bash
Korn
tcsh
:professorcat:

My Moral Fibers have been cut.