Shell Command To Find Substring With Position

Following command is used to find the SubString for a given input with position value.

Following is a example:

$ input='abcdef'; echo ${input:3}

Output:

def

For given input the position starts form zero.

Here for the given input the positions are a:0, b:1; c:2; d:3; e:5; f:5;

-Sany

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s