Recent Changes - Search:

Basics

Languages

Tools

OS

Resources

PmWiki

pmwiki.org

edit SideBar

Cut

Cut a string variables to obtain the desired part. Very useful to get specific words out of a string, or a given variable from an output.

Sentence="This is a bunch of words."
echo $Sentence | cut -d ' ' -f 4
-> bunch

where the -d option defines the delimiter (here a space in order to distinguish words) and the -f option gives the rank of the word (here the 4th word).

Edit - History - Print - Recent Changes - Search
Page last modified on September 17, 2015, at 11:52 AM