From bab726081b56550af42827384cde3518d76144b6 Mon Sep 17 00:00:00 2001 From: bonnie Date: Sun, 8 May 2022 23:33:28 +0800 Subject: [PATCH] fixed example for Variable command --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af72580..b0844d3 100644 --- a/README.md +++ b/README.md @@ -188,11 +188,13 @@ echo ${var[@]#0} ```bash {var//a/,} ``` + +##### Grep lines with strings from a file (e.g. lines with 'stringA or 'stringB' or 'stringC') ```bash #with grep - test="god the father" - grep ${test// /\\\|} file.txt - # turning the space into 'or' (\|) in grep +test="stringA stringB stringC" +grep ${test// /\\\|} file.txt +# turning the space into 'or' (\|) in grep ``` ##### To change the case of the string stored in the variable to lowercase (Parameter Expansion)