August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Unix commands helps

grep grep is a saviour command for unix users. grep can be used to search for patterns in a file or standard input. The pattern search includes finding the line number of the keyword, counting the number of occurrences of a keyword and many more. we will see in the following examples.

Example 1) grep […]

IFS – Internal Field Separator

It seems like an esoteric concept, but it’s actually very useful.

If your input file is “1 apple steve@example.com”, then your script could say:

while read qty product customer do echo “${customer} wants ${qty} ${product}(s)” done The read command will read in the three variables, because they’re spaced out from each other.

However, critical data […]

Bash cheat sheet

Grep

Grep with large pattern files

When I investigated the run times of grep -f related to large pattern files (with hundreds of lines and more) it became apparent that one can speed up grep by splitting up the pattern files into smaller chunks.

I tested this with GNU grep 2.5.3 on a machine with an […]