From edf49fe7a3b87067035889e79a14ba717e02c1a8 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Fri, 21 Jun 2024 01:36:40 +0100 Subject: [PATCH] Solve some problems in Bash --- bash/193.sh | 2 ++ bash/195.sh | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 bash/193.sh create mode 100644 bash/195.sh diff --git a/bash/193.sh b/bash/193.sh new file mode 100644 index 0000000..a39579c --- /dev/null +++ b/bash/193.sh @@ -0,0 +1,2 @@ +# Read from the file file.txt and output all valid phone numbers to stdout. +grep -P "^\(\d{3}\) \d{3}-\d{4}$|^\d{3}-\d{3}-\d{4}$" file.txt diff --git a/bash/195.sh b/bash/195.sh new file mode 100644 index 0000000..b224532 --- /dev/null +++ b/bash/195.sh @@ -0,0 +1,2 @@ +# Read from the file file.txt and output the tenth line to stdout. +head -n 10 file.txt | tail -n +10