You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shell-pipelines/ls-grep/script-03.sh
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,3 +4,6 @@ set -euo pipefail
4
4
5
5
# TODO: Write a command to output the names of the files in the sample-files directory whose name starts with an upper case letter and doesn't contain any other upper case letters.
6
6
# Your output should contain 7 files.
7
+
ls sample-files/| grep '^[A-Z][^A-Z]*$'
8
+
9
+
# [^A-Z]*S A character that is not an uppercase letter ^ inside brackets means negation, * shows zero occurrences of it and $ ensures we are matching the whole file name
Copy file name to clipboardExpand all lines: shell-pipelines/ls-grep/script-04.sh
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,3 +4,4 @@ set -euo pipefail
4
4
5
5
# TODO: Write a command to count the number of files in the sample-files directory whose name starts with an upper case letter and doesn't contain any other upper case letters.
0 commit comments