Networking-Forums.com

General Category => Blogs of Interest and Note => Topic started by: ggnfs000 on January 13, 2017, 12:01:54 PM

Title: linux shell intro
Post by: ggnfs000 on January 13, 2017, 12:01:54 PM
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 (//)
Title: Re: linux shell intro
Post by: icecream-guy on January 13, 2017, 12:48:35 PM
and which shell is the shell of choice ?

Bourne
C shell
Bash
Korn
tcsh