Solve some problems in Bash

This commit is contained in:
Kiril Kovachev 2024-06-21 01:36:40 +01:00
parent b438dd5395
commit edf49fe7a3
2 changed files with 4 additions and 0 deletions

2
bash/193.sh Normal file
View File

@ -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

2
bash/195.sh Normal file
View File

@ -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